@everymatrix/casino-page 0.0.95 → 0.0.96
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/dist/casino-page.js +596 -591
- package/dist/casino-page.js.map +1 -1
- package/package.json +2 -2
- package/src/CasinoPage.svelte +62 -61
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@everymatrix/casino-page",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.96",
|
|
4
4
|
"main": "dist/casino-page.js",
|
|
5
5
|
"svelte": "src/index.ts",
|
|
6
6
|
"scripts": {
|
|
@@ -36,5 +36,5 @@
|
|
|
36
36
|
"publishConfig": {
|
|
37
37
|
"access": "public"
|
|
38
38
|
},
|
|
39
|
-
"gitHead": "
|
|
39
|
+
"gitHead": "a5b786cbdb55417fffbe2510fa634b4633cd1eb4"
|
|
40
40
|
}
|
package/src/CasinoPage.svelte
CHANGED
|
@@ -113,45 +113,47 @@
|
|
|
113
113
|
break;
|
|
114
114
|
|
|
115
115
|
case 'MOSTPLAYED':
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
116
|
+
if (mostplayed == 'true') {
|
|
117
|
+
/*getMostPlayedGames({
|
|
118
|
+
limit: 10,
|
|
119
|
+
device: getDevice(userAgent),
|
|
120
|
+
rounds: 25 //50
|
|
121
|
+
}).then((res:any) => {
|
|
122
|
+
// if (res.count > 0) { // After NorWAy fix
|
|
123
|
+
if (res.count >= 0) {
|
|
124
|
+
let promises:any = [];
|
|
125
|
+
res.items = [{gameId: '15786'}, {gameId: '15788'}];
|
|
126
|
+
res.items.forEach((item:any) => {
|
|
127
|
+
let url = new URL(getGameUrl + `/${item.gameId}`);
|
|
128
|
+
|
|
129
|
+
promises.push(xhrFetch(url));
|
|
130
|
+
});
|
|
131
|
+
|
|
132
|
+
Promise.all(promises).then((values:any) => {
|
|
133
|
+
mostPlayedGames = values.map((item:any) => item[0]);
|
|
134
|
+
window.postMessage({ type: 'MostPlayedData', mostPlayedGames }, window.location.href);
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
});*/
|
|
138
|
+
let mostPlayedGames = getMostPlayedGamesFromCookie();
|
|
139
|
+
let promises:any = [];
|
|
139
140
|
|
|
140
|
-
|
|
141
|
-
|
|
141
|
+
mostPlayedGames.forEach((item:any) => {
|
|
142
|
+
let url = new URL(`${endpoint}/casino/games/${item.gameId}`);
|
|
142
143
|
|
|
143
|
-
|
|
144
|
-
|
|
144
|
+
promises.push(fetch(url).then((res:any) => res.json()));
|
|
145
|
+
});
|
|
145
146
|
|
|
146
|
-
|
|
147
|
-
|
|
147
|
+
Promise.all(promises).then((values:any) => {
|
|
148
|
+
mostPlayedGames = values.map((item:any) => item[0]);
|
|
148
149
|
|
|
149
|
-
|
|
150
|
-
|
|
150
|
+
window.postMessage({ type: 'MostPlayedData', mostPlayedGames }, window.location.href);
|
|
151
|
+
});
|
|
151
152
|
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
153
|
+
activeCategory = '';
|
|
154
|
+
lobbyScreen = false;
|
|
155
|
+
mostPlayedScreen = true;
|
|
156
|
+
}
|
|
155
157
|
break;
|
|
156
158
|
|
|
157
159
|
default:
|
|
@@ -292,32 +294,34 @@
|
|
|
292
294
|
// --- START of Favorites section
|
|
293
295
|
//
|
|
294
296
|
let getFavoredGames = (url:string, sessionID:string, playerID:string) => {
|
|
295
|
-
if (
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
297
|
+
if (favorites == 'true') {
|
|
298
|
+
if (session && playerID) {
|
|
299
|
+
let options = {
|
|
300
|
+
method: "GET",
|
|
301
|
+
headers: {
|
|
302
|
+
'X-SessionID': sessionID,
|
|
303
|
+
}
|
|
304
|
+
};
|
|
302
305
|
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
306
|
+
fetch(`${url}/player/${playerID}/favorites/`, options)
|
|
307
|
+
.then((res:any) => res.json())
|
|
308
|
+
.then((updatedArray:Object) => {
|
|
309
|
+
receivedFavoriteResults = updatedArray;
|
|
307
310
|
|
|
308
|
-
|
|
309
|
-
|
|
311
|
+
if (receivedFavoriteResults) {
|
|
312
|
+
window.postMessage({ type: "UpdateCategoryFavoriteGames", receivedFavoriteResults }, window.location.href);
|
|
310
313
|
|
|
311
|
-
|
|
312
|
-
|
|
314
|
+
updatedFavoriteResultsIds = getGamesIds(receivedFavoriteResults.items);
|
|
315
|
+
}
|
|
313
316
|
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
317
|
+
return receivedFavoriteResults;
|
|
318
|
+
}).catch((err:any) => {
|
|
319
|
+
console.error(err);
|
|
320
|
+
});
|
|
318
321
|
|
|
319
|
-
|
|
320
|
-
|
|
322
|
+
if (favoritesScreen) {
|
|
323
|
+
showFavoriteGames(url, sessionID, playerID);
|
|
324
|
+
}
|
|
321
325
|
}
|
|
322
326
|
}
|
|
323
327
|
}
|
|
@@ -390,7 +394,7 @@
|
|
|
390
394
|
updateFavoredList(url, sessionID, playerID);
|
|
391
395
|
})
|
|
392
396
|
.catch((err:any) => {
|
|
393
|
-
console.
|
|
397
|
+
console.error('Err', err);
|
|
394
398
|
});
|
|
395
399
|
}
|
|
396
400
|
|
|
@@ -644,10 +648,6 @@
|
|
|
644
648
|
window.postMessage({ type: "scroll" }, window.location.href);
|
|
645
649
|
}
|
|
646
650
|
|
|
647
|
-
const searchOngoing = () => {
|
|
648
|
-
console.log("searchValue ", searchValue);
|
|
649
|
-
}
|
|
650
|
-
|
|
651
651
|
const clearSearchbar = () => {
|
|
652
652
|
searchBarCleared = true;
|
|
653
653
|
searchValue = '';
|
|
@@ -742,6 +742,7 @@
|
|
|
742
742
|
const initialSetup = () => {
|
|
743
743
|
if (!checkAttrs()) {
|
|
744
744
|
isLoading = true;
|
|
745
|
+
|
|
745
746
|
if (favorites == 'true') {
|
|
746
747
|
getFavoredGames(endpoint, sessionID, playerID);
|
|
747
748
|
}
|
|
@@ -865,7 +866,7 @@
|
|
|
865
866
|
</svg>
|
|
866
867
|
</div>
|
|
867
868
|
{/if}
|
|
868
|
-
<input id="SearchField" class="SearchInput" on:focus={onFocus} on:blur={onBlur} bind:this={searchElement} bind:value={searchValue} placeholder="{(getDevice(userAgent) === 'PC') ? $_('casinoPage.search') : $_('casinoPage.searchMobile')}" type="search" on:focus={searchActivated}
|
|
869
|
+
<input id="SearchField" class="SearchInput" on:focus={onFocus} on:blur={onBlur} bind:this={searchElement} bind:value={searchValue} placeholder="{(getDevice(userAgent) === 'PC') ? $_('casinoPage.search') : $_('casinoPage.searchMobile')}" type="search" on:focus={searchActivated} />
|
|
869
870
|
{#if ((getDevice(userAgent) === 'PC') && searchValue.length) || (getDevice(userAgent) !== 'PC') }
|
|
870
871
|
<span class="{(getDevice(userAgent) === 'PC') ? 'ClearSearchButton' : 'ClearSearchButtonMobile'} " on:click="{() => clearSearchbar()}">
|
|
871
872
|
<div class="CloseIconContainer">
|