@inappstory/game-center-api 1.3.1 → 1.3.3
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/ResourceManager.js
CHANGED
|
@@ -83,14 +83,17 @@ class ResourceManager {
|
|
|
83
83
|
});
|
|
84
84
|
}
|
|
85
85
|
async createObjectUrlByUri(uri, resouceKeys) {
|
|
86
|
-
if (!uri)
|
|
86
|
+
if (!uri) {
|
|
87
87
|
throw `Resource uri for [${resouceKeys.join(", ")}] can't be empty string`;
|
|
88
|
+
}
|
|
88
89
|
try {
|
|
89
90
|
const response = await (0, fetchLocalFile_1.fetchLocalFile)(uri);
|
|
90
|
-
if (response != null)
|
|
91
|
+
if (response != null && response.ok) {
|
|
91
92
|
return URL.createObjectURL(await response.blob());
|
|
92
|
-
|
|
93
|
+
}
|
|
94
|
+
else {
|
|
93
95
|
throw "";
|
|
96
|
+
}
|
|
94
97
|
}
|
|
95
98
|
catch (err) {
|
|
96
99
|
console.warn(`Error to fetch ${uri} for related images [${resouceKeys.join(", ")}]`, err);
|
package/lib/sdkApi/initGame.js
CHANGED
|
@@ -118,6 +118,11 @@ const createInitGame = (initLocalData, mounted = () => { }) => {
|
|
|
118
118
|
if (gameLaunchConfig_1.gameLaunchConfig?.clientConfig?.nonce) {
|
|
119
119
|
(0, createNonce_1.createNonce)(gameLaunchConfig_1.gameLaunchConfig?.clientConfig?.nonce);
|
|
120
120
|
}
|
|
121
|
+
if (gameLaunchConfig_1.gameLaunchConfig?.clientConfig?.dir) {
|
|
122
|
+
// for web-sdk - set dir attribute from clientConfig
|
|
123
|
+
// bcz web-sdk cannot access to document.documentElement inside game iFrame
|
|
124
|
+
window.document.documentElement.dir = gameLaunchConfig_1.gameLaunchConfig?.clientConfig?.dir;
|
|
125
|
+
}
|
|
121
126
|
await initLocalData();
|
|
122
127
|
mounted();
|
|
123
128
|
window.gameLoadingInfo.state = "after call initGame";
|