Skip to content

Commit

Permalink
Improved: Added a condition to validate productStoreId while retrievi…
Browse files Browse the repository at this point in the history
…ng product identification from DXP after a refresh (#dxp/193)
  • Loading branch information
R-Sourabh committed Dec 18, 2024
1 parent 0e1b254 commit 15b5d7d
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -137,13 +137,10 @@ export default defineComponent({
Settings.defaultZone = this.userProfile.userTimeZone;
}
// need to discuss this case
// await useUserStore().getEComStoresByFacility('');
// await useUserStore().getPreferredStore('SELECTED_BRAND');
const currentEComStore: any = useUserStore().getCurrentEComStore;
// If fetching identifier without checking token then on login the app stucks in a loop, as the mounted hook runs before
// token is available which results in api failure as unauthenticated, thus making logout call and then login call again and so on.
if(this.userToken) {
if(this.userToken && currentEComStore?.productStoreId) {
// Get product identification from api using dxp-component
await useProductIdentificationStore().getIdentificationPref(currentEComStore.productStoreId)
.catch((error) => logger.error(error));
Expand Down

0 comments on commit 15b5d7d

Please sign in to comment.