@nuskin/ns-shop 7.0.5-cx1-13272.9 → 7.0.5-cx1-13272.10
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 +14 -0
package/package.json
CHANGED
package/src/salesEventService.js
CHANGED
|
@@ -205,6 +205,8 @@ function logAnalyticInfo(tag, eventName, data = {}) {
|
|
|
205
205
|
*/
|
|
206
206
|
let initEventTicketCallMap = {};
|
|
207
207
|
async function _initEventTicketInfo(eventName, refreshTicket = false) {
|
|
208
|
+
myAlert(`_initEventTicketInfo, ${eventName}`);
|
|
209
|
+
|
|
208
210
|
let initInfo = initEventTicketCallMap[eventName];
|
|
209
211
|
if (!initInfo) {
|
|
210
212
|
initInfo = {initialized: false, refreshTime: 0};
|
|
@@ -782,12 +784,20 @@ async function _checkForMissingTicket(eventName) {
|
|
|
782
784
|
}
|
|
783
785
|
}
|
|
784
786
|
|
|
787
|
+
function myAlert(msg) {
|
|
788
|
+
if (window.ReactNativeWebView) {
|
|
789
|
+
alert(msg);
|
|
790
|
+
}
|
|
791
|
+
}
|
|
792
|
+
|
|
785
793
|
/**
|
|
786
794
|
* This initializes an interval timer which checks to see if the browser (computer)
|
|
787
795
|
* went to sleep. It's intention is to update the wait timer if it has.
|
|
788
796
|
*/
|
|
789
797
|
async function _initializePolling() {
|
|
798
|
+
myAlert('_initializePolling');
|
|
790
799
|
if (!intervalId) {
|
|
800
|
+
myAlert('_initializePolling - no intervalId');
|
|
791
801
|
const TIMEOUT = 10000;
|
|
792
802
|
let lastTime = Date.now(),
|
|
793
803
|
intervalCnt = 1;
|
|
@@ -796,6 +806,8 @@ async function _initializePolling() {
|
|
|
796
806
|
const now = Date.now();
|
|
797
807
|
const slept = now > (lastTime + TIMEOUT + 3000)
|
|
798
808
|
|
|
809
|
+
myAlert('polling triggered');
|
|
810
|
+
|
|
799
811
|
// if polling market config, only reload it every 30 seconds
|
|
800
812
|
if (slept || pollMarketConfig && intervalCnt % 6 === 0) {
|
|
801
813
|
await _loadMarketEventConfig(true);
|
|
@@ -1018,6 +1030,8 @@ async function initActiveEvents(country = undefined) {
|
|
|
1018
1030
|
}
|
|
1019
1031
|
|
|
1020
1032
|
return Promise.all(promises).then(async () => {
|
|
1033
|
+
myAlert(`Initial Events, ${[Object.keys(activeEventMap)]}`);
|
|
1034
|
+
|
|
1021
1035
|
events.setValue(events.salesevent.INITIAL_ACTIVE_EVENTS, [Object.keys(activeEventMap)]);
|
|
1022
1036
|
|
|
1023
1037
|
// If there are event tickets then initialize polling
|