@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
|
@@ -47,14 +47,30 @@ function _getEquinoxSession() {
|
|
|
47
47
|
method: 'GET',
|
|
48
48
|
endpoint: 'customers'
|
|
49
49
|
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
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
|
-
|
|
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"
|
|
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
|
? {
|