@everymatrix/casino-games-category-section 0.0.259 → 0.0.260
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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@everymatrix/casino-games-category-section",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.260",
|
|
4
4
|
"main": "dist/casino-games-category-section.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": "a30fdd6f6180c69aabbc0daf1bf2a2e1342bf0e2"
|
|
40
40
|
}
|
|
@@ -65,12 +65,8 @@
|
|
|
65
65
|
let favoriteGames:Array<Object>;
|
|
66
66
|
let showFavGamesCategory:boolean = false;
|
|
67
67
|
let receivedFavoriteResults:Object;
|
|
68
|
-
let activeCategory:String;
|
|
69
|
-
let operatorConfig:any = window.widgetConfig;
|
|
70
|
-
let favoredGamesCollection:Array<string> = [];
|
|
71
68
|
let sessionId:string = '';
|
|
72
69
|
let userId:string = '';
|
|
73
|
-
let getFavoredGamesCache:any = undefined;
|
|
74
70
|
let mostPlayedScreen:Boolean = false;
|
|
75
71
|
let customStylingContainer:HTMLElement;
|
|
76
72
|
let validObservers:boolean = false;
|
|
@@ -105,7 +101,7 @@
|
|
|
105
101
|
}
|
|
106
102
|
|
|
107
103
|
// IntersectionObserver used for loading more games
|
|
108
|
-
let observer = new IntersectionObserver((entries
|
|
104
|
+
let observer = new IntersectionObserver((entries) => {
|
|
109
105
|
entries.forEach(async (entry) => {
|
|
110
106
|
let gameid = entry.target.gameid; // eslint-disable-line
|
|
111
107
|
let index = entry.target.elems_index; // eslint-disable-line
|
|
@@ -383,7 +379,7 @@
|
|
|
383
379
|
}
|
|
384
380
|
}
|
|
385
381
|
}
|
|
386
|
-
|
|
382
|
+
|
|
387
383
|
// @TODO categoryId type fix
|
|
388
384
|
const loadMoreGames = (categoryId:any) => {
|
|
389
385
|
limit += 1;
|
|
@@ -400,15 +396,6 @@
|
|
|
400
396
|
}
|
|
401
397
|
}
|
|
402
398
|
|
|
403
|
-
// construct favorite array used to check if game id is not already present in fav list
|
|
404
|
-
const getGamesIds = (favoritesArray:any) => {
|
|
405
|
-
favoredGamesCollection = [];
|
|
406
|
-
favoritesArray.items.forEach((fav:any) => {
|
|
407
|
-
favoredGamesCollection.push(fav.id);
|
|
408
|
-
});
|
|
409
|
-
return favoredGamesCollection;
|
|
410
|
-
}
|
|
411
|
-
|
|
412
399
|
const checkFavorite = (gameId:string) => {
|
|
413
400
|
if (favoriteGames) {
|
|
414
401
|
if (favoriteGames.findIndex(obj => obj.id == gameId) !== -1) {
|
|
@@ -471,18 +458,14 @@
|
|
|
471
458
|
}
|
|
472
459
|
}
|
|
473
460
|
|
|
474
|
-
// const setupVisibility = (customStylingContainer, dataloaded) => {
|
|
475
|
-
// if (customStylingContainer && dataloaded && hidden) {
|
|
476
|
-
// document.addEventListener(visibilityChange, handleVisibilityChange, false);
|
|
477
|
-
// }
|
|
478
|
-
// }
|
|
479
|
-
|
|
480
461
|
onMount(() => {
|
|
462
|
+
window.addEventListener('visibilitychange', (e) => handleVisibilityChange())
|
|
481
463
|
window.addEventListener('message', messageHandler, false);
|
|
482
464
|
window.postMessage({ type: 'GetFavoredGame' }, window.location.href);
|
|
483
465
|
|
|
484
466
|
return () => {
|
|
485
467
|
window.removeEventListener('message', messageHandler);
|
|
468
|
+
window.removeEventListener('visibilitychange', messageHandler);
|
|
486
469
|
}
|
|
487
470
|
});
|
|
488
471
|
|