@nuskin/ns-shop 7.0.5-cx1-13272.13 → 7.0.5-cx1-13272.15
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 +1 -1
- package/src/salesEventService.js +3 -7
package/package.json
CHANGED
package/src/salesEventService.js
CHANGED
|
@@ -786,6 +786,7 @@ function getStorageItem(key) {
|
|
|
786
786
|
|
|
787
787
|
async function _checkForMissingTicket(eventName) {
|
|
788
788
|
if (mktEventConfigMap[eventName] && !eventTicketInfoMap[eventName]) {
|
|
789
|
+
myAlert(`missing ticket for ${eventName}`)
|
|
789
790
|
await _initEventTicketInfo(eventName);
|
|
790
791
|
}
|
|
791
792
|
}
|
|
@@ -801,9 +802,7 @@ function myAlert(msg) {
|
|
|
801
802
|
* went to sleep. It's intention is to update the wait timer if it has.
|
|
802
803
|
*/
|
|
803
804
|
async function _initializePolling() {
|
|
804
|
-
myAlert('_initializePolling');
|
|
805
805
|
if (!intervalId) {
|
|
806
|
-
myAlert('_initializePolling - no intervalId');
|
|
807
806
|
const TIMEOUT = 10000;
|
|
808
807
|
let lastTime = Date.now(),
|
|
809
808
|
intervalCnt = 1;
|
|
@@ -812,8 +811,6 @@ async function _initializePolling() {
|
|
|
812
811
|
const now = Date.now();
|
|
813
812
|
const slept = now > (lastTime + TIMEOUT + 3000)
|
|
814
813
|
|
|
815
|
-
myAlert('polling triggered');
|
|
816
|
-
|
|
817
814
|
// if polling market config, only reload it every 30 seconds
|
|
818
815
|
if (slept || pollMarketConfig && intervalCnt % 6 === 0) {
|
|
819
816
|
await _loadMarketEventConfig(true);
|
|
@@ -838,7 +835,7 @@ async function _initializePolling() {
|
|
|
838
835
|
if (window.location.pathname === '/static/checkout/checkout.html') {
|
|
839
836
|
// check for missing tickets. Only perform on checkout s
|
|
840
837
|
const activeEvents = await _getActiveEvents();
|
|
841
|
-
myAlert(`Active Event check, ${JSON.stringify(
|
|
838
|
+
myAlert(`Active Event check, ${JSON.stringify(activeEvents.map(ae => ae.eventName))}`);
|
|
842
839
|
|
|
843
840
|
for (const eventInfo of activeEvents) {
|
|
844
841
|
await _checkForMissingTicket(eventInfo.eventName);
|
|
@@ -970,7 +967,7 @@ function _removeWaitCheck(value) {
|
|
|
970
967
|
*/
|
|
971
968
|
async function _loadAwsActiveEvents(country) {
|
|
972
969
|
let activeEventsName = `${ACTIVE_EVENTS}-${country? country: RunConfigService.getRunConfig().country}`,
|
|
973
|
-
storageObj = getStorageItem(activeEventsName),
|
|
970
|
+
storageObj = null, // getStorageItem(activeEventsName),
|
|
974
971
|
ttl = storageObj ? storageObj.ttl - Date.now() : ACTIVE_EVENT_TTL,
|
|
975
972
|
eventInfos = {},
|
|
976
973
|
ok = true;
|
|
@@ -1123,7 +1120,6 @@ const csConfigCallback = async (configs) => {
|
|
|
1123
1120
|
if (configs != null && isSubset(configs, neededConfigMaps)) {
|
|
1124
1121
|
events.unsubscribe(events.global.CS_CONFIG_SET, csConfigCallback);
|
|
1125
1122
|
isGuest = CheckoutModeService.isGuestCheckout();
|
|
1126
|
-
if (isGuest) alert(`isGuest ${isGuest}`)
|
|
1127
1123
|
_init(false).then(() => console.log('salesEventService initialized'));
|
|
1128
1124
|
}
|
|
1129
1125
|
}
|