-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2170 from graphcommerce-org/feature/GCOM-1317
fix(GCOM-1317): fix bug where inactive cached cart could be set as currentCartId
- Loading branch information
Showing
3 changed files
with
12 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
"@graphcommerce/magento-cart": patch | ||
"@graphcommerce/magento-customer": patch | ||
--- | ||
|
||
fix(GCOM-1317): fix bug where inactive cached cart could be set as currentCartId |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
import { ApolloClient } from '@graphcommerce/graphql' | ||
|
||
export function signOut(client: ApolloClient<object>) { | ||
client.cache.evict({ fieldName: 'cart' }) | ||
client.cache.evict({ fieldName: 'customer' }) | ||
client.cache.evict({ fieldName: 'customerCart' }) | ||
client.cache.evict({ fieldName: 'currentCartId' }) | ||
client.cache.evict({ fieldName: 'currentCartId', broadcast: true }) | ||
client.cache.evict({ fieldName: 'cart', broadcast: true }) | ||
client.cache.evict({ fieldName: 'customerToken', broadcast: true }) | ||
client.cache.evict({ fieldName: 'customer', broadcast: true }) | ||
client.cache.evict({ fieldName: 'customerCart', broadcast: true }) | ||
} |