@nuskin/ns-shop 7.0.11-CodeFix.1 → 7.0.11-cx24-7213.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.0.11-CodeFix.1",
3
+ "version": "7.0.11-cx24-7213.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": {
@@ -47,14 +47,30 @@ function _getEquinoxSession() {
47
47
  method: 'GET',
48
48
  endpoint: 'customers'
49
49
  }
50
- const customerSession = sessionStorage.getItem('customerSession') ? JSON.parse(sessionStorage.getItem('customerSession')) : ''
51
- if (customerSession === '') {
52
- sessionStorage.setItem('customerSession', true)
53
- return _equinoxRequest(equinoxRequestOptions)
50
+
51
+ console.log("Equinox session");
52
+
53
+ // const customerSession = sessionStorage.getItem('customerSession') ? JSON.parse(sessionStorage.getItem('customerSession')) : ''
54
+ // if (customerSession === '') {
55
+ // sessionStorage.setItem('customerSession', true)
56
+ // return _equinoxRequest(equinoxRequestOptions)
57
+ // } else {
58
+ // return null
59
+ // }
60
+
61
+ let customerSession = sessionStorage.getItem('customerSession');
62
+ if (!customerSession) {
63
+ console.log("No session found, creating a new one");
64
+ return _equinoxRequest(equinoxRequestOptions).then(response => {
65
+ sessionStorage.setItem('customerSession', JSON.stringify(response.data));
66
+ return response;
67
+ });
54
68
  } else {
55
- return null
69
+ console.log("Session found");
70
+ return Promise.resolve(JSON.parse(customerSession));
56
71
  }
57
-
72
+
73
+ // return _equinoxRequest(equinoxRequestOptions);
58
74
 
59
75
  }
60
76
 
@@ -404,7 +420,7 @@ function _assembleChildSkus(requestData, options) {
404
420
  if(personalOffer != null && productWithVariant.length > 0 && productWithVariant[0].variantSelected){
405
421
  selectedVariants = productWithVariant[0].variantSelected;
406
422
  }
407
- if (personalOffer != null && selectedVariants && cs.skuId != selectedVariants[cs.productId] && (cs.type !== "BUNDLE" && cs.type !== "OPTIONAL" && cs.type !== "SKUKIT")) return null
423
+ if (personalOffer != null && selectedVariants && cs.skuId != selectedVariants[cs.productId] && (cs.type !== "BUNDLE" && cs.type !== "OPTIONAL")) return null
408
424
  const childSku =
409
425
  (personalOffer != null && selectedVariants && selectedVariants[cs.productId] && config.MySite_graphql_active)
410
426
  ? {