@nuskin/ns-shop 7.9.1-td-4379.1 → 7.9.1-td-4379.2

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.1",
3
+ "version": "7.9.1-td-4379.2",
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": {
@@ -391,27 +391,19 @@ function goToCartPage() {
391
391
  const currentEnvironment = RunConfigService.getEnvironmentCode();
392
392
  const env = currentEnvironment !== 'prod' ? 'test.' : '';
393
393
  let shoppingContext = storage.getItem(storage.keys.SHOPPING_CONTEXT);
394
- let sessionStorefront = sessionStorage.getItem(storage.keys.STOREFRONT);
394
+ let sessionStorefront = sessionStorage.getItem('storefront') ? JSON.parse(sessionStorage.getItem('storefront')) : null;
395
395
 
396
396
  if (!shoppingContext) {
397
397
  shoppingContext = _getSessionShoppingContext();
398
398
  }
399
399
 
400
- if (sessionStorefront) {
401
- try {
402
- sessionStorefront = JSON.parse(sessionStorefront);
403
- } catch (e) {
404
- sessionStorefront = null;
405
- }
406
- }
407
-
408
400
  let url = `https://${env}nuskin.com/${market.toLowerCase()}/${locale.toLowerCase()}/viewCart`;
409
401
 
410
402
  if (shoppingContext && shoppingContext.context === "storefront") {
411
403
  url = `https://mysite.${env}mynuskin.com/${market.toLowerCase()}/${locale.toLowerCase()}/viewCart`;
412
404
  }
413
405
 
414
- if (sessionStorefront && sessionStorefront.user.shopUrl && sessionStorefront.user.sapId) {
406
+ if (sessionStorefront && sessionStorefront.user && sessionStorefront.user.shopUrl && sessionStorefront.user.sapId) {
415
407
  if (shoppingContext && shoppingContext.context === "storefront") {
416
408
  const shopUrl = sessionStorefront.user.shopUrl;
417
409
  url = `https://${env}nuskin.com/${market.toLowerCase()}/${locale.toLowerCase()}/mysite/${shopUrl}/viewCart`;