@nuskin/ns-shop 6.1.0 → 6.1.1

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": "6.1.0",
3
+ "version": "6.1.1",
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": {
@@ -1107,8 +1107,17 @@ events.subscribe(events.salesevent.ACTIVE_EVENTS, (/*activeEvents*/) => {
1107
1107
  }
1108
1108
  });
1109
1109
 
1110
+ // persistentCartService needs to wait until the following configMaps are loaded
1111
+ // before this service can be initialized.
1112
+ const neededConfigMaps = ['Loyalty', 'Cart'];
1113
+
1114
+ const isSubset = (array1, array2) => {
1115
+ return array2.every((element) => array1.includes(element));
1116
+ }
1117
+
1118
+
1110
1119
  const csConfigCallback = async (configs) => {
1111
- if (configs != null) {
1120
+ if (configs != null && isSubset(configs, neededConfigMaps)) {
1112
1121
  events.unsubscribe(events.global.CS_CONFIG_SET, csConfigCallback);
1113
1122
  _init(false).then(() => console.log('salesEventService initialized'));
1114
1123
  }