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