Skip to content

Commit

Permalink
Domain transfer: Clear store in complete step (#79538)
Browse files Browse the repository at this point in the history
  • Loading branch information
alshakero authored Jul 18, 2023
1 parent 3b70b9b commit 6385572
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,19 @@ const Complete: Step = function Complete( { flow } ) {

useEffect( () => {
dispatch( fetchUserPurchases( userId ) );
}, [] );
}, [ dispatch, userId ] );

// Once user purchases are loaded, we don't need the information in the store anymore and can discard it.
useEffect( () => {
if ( userPurchases ) {
resetOnboardStore();
}
}, [ userPurchases, resetOnboardStore ] );

const clearDomainsStore = () => {
recordTracksEvent( 'calypso_domain_transfer_complete_click', {
destination: '/setup/domain-transfer',
} );
resetOnboardStore();
};

return (
Expand Down

0 comments on commit 6385572

Please sign in to comment.