@inappstory/game-center-api 1.3.3 → 1.3.4
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/lib/logger.html +2 -1
- package/lib/sdkApi/initGame.d.ts +1 -0
- package/lib/sdkApi/initGame.js +4 -0
- package/package.json +1 -1
package/lib/logger.html
CHANGED
|
@@ -38,7 +38,8 @@
|
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
setTimeout(function () {
|
|
41
|
-
if (!window.gameLoadingInfo.
|
|
41
|
+
if (!window.gameLoadingInfo.loadStarted) {
|
|
42
|
+
// call only on serious js failure (when loadStarted false - parse error, Syntax error, EOL error)
|
|
42
43
|
window.gameLoadFailed(window.gameLoadingInfo.error, false);
|
|
43
44
|
}
|
|
44
45
|
}, 30000);
|
package/lib/sdkApi/initGame.d.ts
CHANGED
package/lib/sdkApi/initGame.js
CHANGED
|
@@ -8,6 +8,7 @@ const Source_1 = require("./web/Source");
|
|
|
8
8
|
const createNonce_1 = require("../createNonce");
|
|
9
9
|
const semver = require("semver");
|
|
10
10
|
window.gameLoadingInfo = {
|
|
11
|
+
loadStarted: false,
|
|
11
12
|
loaded: false,
|
|
12
13
|
state: "before gameReader API creation",
|
|
13
14
|
description: "",
|
|
@@ -103,6 +104,8 @@ window.gameReader = gameReader;
|
|
|
103
104
|
const createInitGame = (initLocalData, mounted = () => { }) => {
|
|
104
105
|
window.initGame = async function (config) {
|
|
105
106
|
try {
|
|
107
|
+
// prevent call window.gameLoadFailed from fallback 30s timer (if js bundle parsed and ready)
|
|
108
|
+
window.gameLoadingInfo.loadStarted = true;
|
|
106
109
|
window.gameLoadingInfo.state = "before call initGame";
|
|
107
110
|
window.gameLoadingInfo.description = JSON.stringify(config);
|
|
108
111
|
if (!(0, isObject_1.isObject)(config)) {
|
|
@@ -222,6 +225,7 @@ const gameLoadedSdkCallbackInternal = (config) => {
|
|
|
222
225
|
}
|
|
223
226
|
};
|
|
224
227
|
window.gameLoadingInfo = {
|
|
228
|
+
loadStarted: false,
|
|
225
229
|
loaded: false,
|
|
226
230
|
state: "gameReader API created",
|
|
227
231
|
description: "",
|