From 62b72163d6127a8a09989bc4182e2ce221893b6f Mon Sep 17 00:00:00 2001 From: Scott Kiener Date: Mon, 25 Jul 2022 15:29:44 -0400 Subject: [PATCH] CSR-706 | Only clear state if referral does not match --- src/store/index.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/store/index.js b/src/store/index.js index 82d3323d1..64ba356e6 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -706,6 +706,10 @@ export const actions = { accountNumber: accountNumber?.toString() }, }).then((response) => { + // clear the state if the existing referral number does not equal what is returned from loadOrder + if (context.state.order.referralNumber != response.data.referralNumber) { + context.commit(storeMutations.RESET_STATE); + } context.commit(storeMutations.UPDATE_STATE_WITH_ORDER_INFORMATION, response.data); return response; });