@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 CHANGED
@@ -38,7 +38,8 @@
38
38
  }
39
39
 
40
40
  setTimeout(function () {
41
- if (!window.gameLoadingInfo.loaded) {
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);
@@ -13,6 +13,7 @@ declare global {
13
13
  _log: (text: string) => void;
14
14
  _sendErrorLog: (payload: Record<string, any>) => void;
15
15
  gameLoadingInfo: {
16
+ loadStarted: boolean;
16
17
  loaded: boolean;
17
18
  state: string;
18
19
  description: string;
@@ -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: "",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inappstory/game-center-api",
3
- "version": "1.3.3",
3
+ "version": "1.3.4",
4
4
  "description": "",
5
5
  "dependencies": {
6
6
  "semver": "^7.3.8",