Skip to content

Commit 0910043

Browse files
committed
Update ApolloClient.js
1 parent 863e402 commit 0910043

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/utils/apollo/ApolloClient.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,8 @@ export const middleware = new ApolloLink((operation, forward) => {
2727

2828
// Check if the token is older than 7 days
2929
if (Date.now() - createdTime > SEVEN_DAYS) {
30-
// If it is, delete it
30+
// If session is expired, remove it
3131
localStorage.removeItem('woo-session');
32-
localStorage.setItem('woocommerce-cart', JSON.stringify({}));
3332
} else {
3433
// If it's not, use the token
3534
operation.setContext(() => ({

0 commit comments

Comments
 (0)