fix error boundary flashing on signout action
This commit is contained in:
@@ -126,18 +126,22 @@ export async function login(_currentState: unknown, formData: FormData) {
|
||||
}
|
||||
}
|
||||
|
||||
export async function medusaLogout(countryCode = 'ee') {
|
||||
export async function medusaLogout(countryCode = 'ee', canRevalidateTags = true) {
|
||||
await sdk.auth.logout()
|
||||
|
||||
await removeAuthToken()
|
||||
|
||||
const customerCacheTag = await getCacheTag("customers")
|
||||
revalidateTag(customerCacheTag)
|
||||
if (canRevalidateTags) {
|
||||
const customerCacheTag = await getCacheTag("customers")
|
||||
revalidateTag(customerCacheTag)
|
||||
}
|
||||
|
||||
await removeCartId()
|
||||
|
||||
const cartCacheTag = await getCacheTag("carts")
|
||||
revalidateTag(cartCacheTag)
|
||||
if (canRevalidateTags) {
|
||||
const cartCacheTag = await getCacheTag("carts")
|
||||
revalidateTag(cartCacheTag)
|
||||
}
|
||||
}
|
||||
|
||||
export async function transferCart() {
|
||||
|
||||
Reference in New Issue
Block a user