@nuskin/ns-shop 7.9.1-td-4379.4 → 7.9.1-td-4379.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuskin/ns-shop",
3
- "version": "7.9.1-td-4379.4",
3
+ "version": "7.9.1-td-4379.5",
4
4
  "description": "The description that will amaze and astound your audience when they read it",
5
5
  "main": "src/shop.js",
6
6
  "scripts": {
@@ -414,11 +414,11 @@ function getSessionShopURL() {
414
414
  const sessionStorefront = sessionStorage.getItem('storefront') ? JSON.parse(sessionStorage.getItem('storefront')) : null;
415
415
  let url;
416
416
 
417
- if (sessionStorefront && sessionStorefront.user && sessionStorefront.user.shopUrl) {
418
- if (shoppingContext && shoppingContext.context === "storefront") {
417
+ if (shoppingContext && sessionStorefront && sessionStorefront.user) {
418
+ if (shoppingContext.context === "storefront" && sessionStorefront.user.shopUrl) {
419
419
  const shopUrl = sessionStorefront.user.shopUrl;
420
420
  url = `/${market.toLowerCase()}/${locale.toLowerCase()}/mysite/${shopUrl}/viewCart`;
421
- } else if (shoppingContext && shoppingContext.context === 'personal_offer' && sessionStorefront.user.sapId) {
421
+ } else if (shoppingContext.context === 'personal_offer' && sessionStorefront.user.sapId) {
422
422
  const sapId = sessionStorefront.user.sapId;
423
423
  url = `/${market.toLowerCase()}/${locale.toLowerCase()}/personal-offer/${sapId}/viewCart`;
424
424
  }