Skip to content

Commit

Permalink
PWA-3134::The signout event is not captured (#4121)
Browse files Browse the repository at this point in the history
* PWA-3134::The signout event is not captured

* PWA-3134::Resolved lint issues

* PWA-3134::Formatted the code

* PWA-3134::The signout event is not captured

---------

Co-authored-by: arpit khare <[email protected]>
Co-authored-by: Aanchal Pawar <[email protected]>
Co-authored-by: glo82145 <[email protected]>
  • Loading branch information
4 people authored May 24, 2023
1 parent 13d295a commit 7157194
Showing 1 changed file with 32 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
const canHandle = event => event.type === 'USER_SIGN_OUT';

const handle = sdk => {
sdk.context.setShopper({
shopperId: 'guest'
});

const accountContext = {
firstName: '',
lastName: '',
emailAddress: ''
};

const cartContext = {
id,
prices: {},
items: {},
possibleOnepageCheckout: false,
giftMessageSelected: false,
giftWrappingSelected: false
};

sdk.context.setShoppingCart(cartContext);
sdk.context.setAccount(accountContext);

sdk.publish.signOut();
};

export default {
canHandle,
handle
};

0 comments on commit 7157194

Please sign in to comment.