@everymatrix/casino-games-category-section 1.0.13 → 1.0.15

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": "1.0.13",
3
+ "version": "1.0.15",
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": "4b2bbc7cb2c3424950a39147a985ac5d38207cdf"
39
+ "gitHead": "0ee1d4bccc4964628711251119148f0a04ba10df"
40
40
  }
@@ -20,6 +20,7 @@
20
20
  export let favorites:string = '';
21
21
  export let clientstyling:string = '';
22
22
  export let clientstylingurl:string = '';
23
+ export let translationUrl:string = '';
23
24
  export let currency:string = '';
24
25
 
25
26
  export let categoryid:string = '';
@@ -89,6 +90,19 @@
89
90
  };
90
91
  /* End Lazy Loading */
91
92
 
93
+ const setTranslationUrl = ():void => {
94
+ let url:string = translationUrl;
95
+
96
+ fetch(url).then((res:any) => res.json())
97
+ .then((res) => {
98
+ Object.keys(res).forEach((item:any):void => {
99
+ addNewMessages(item, res[item]);
100
+ });
101
+ }).catch((err:any) => {
102
+ console.log(err);
103
+ });
104
+ }
105
+
92
106
  Object.keys(GamesCategorySectionTranslations).forEach((item) => {
93
107
  addNewMessages(item, GamesCategorySectionTranslations[item]);
94
108
  });
@@ -373,19 +387,23 @@
373
387
 
374
388
  // Start favorite category section
375
389
  case 'UpdateCategoryFavoriteGames':
390
+
376
391
  if (e.data.receivedFavoriteResults) {
377
392
  favoriteGames = e.data.receivedFavoriteResults.items;
378
- if (!showFavGamesCategory) {
393
+ if(e.data.favStadalone) return;
394
+ if(showFavGamesCategory) {
395
+ if(!lobbyView && !mostPlayedScreen) {
396
+ window.postMessage({ type: 'CategoryUpdate', itemId: categoryid }, window.location.href);
397
+ }
398
+ } else {
379
399
  window.postMessage({ type: 'FavoriteUpdate' }, window.location.href);
380
- } else if (!lobbyView && !mostPlayedScreen) {
381
- window.postMessage({ type: 'CategoryUpdate', itemId: categoryid }, window.location.href);
382
400
  }
383
401
  }
384
402
  break;
385
403
 
386
404
  case 'ShowFavoriteSection':
387
405
  let favGameArray;
388
-
406
+ lobbyView = false;
389
407
  if (e.data) {
390
408
  favGameArray = e.data.receivedFavoriteResults.items;
391
409
  if (favGameArray.length) {
@@ -405,7 +423,6 @@
405
423
  case 'UserSessionID':
406
424
  sessionID = e.data.session;
407
425
  playerID = e.data.userID;
408
-
409
426
  if (favorites == 'true') {
410
427
  if (playerID && playerID.length && sessionID && sessionID.length > 0) {
411
428
  getFavoredGames(`${endpoint}/player/${playerID}/favorites/`, sessionID, playerID);
@@ -517,6 +534,7 @@
517
534
 
518
535
  $: dataloaded && thumbnailContainer && setupObserver();
519
536
  $: lang && initialSetup();
537
+ $: translationUrl && setTranslationUrl();
520
538
  $: clientstyling && customStylingContainer && setClientStyling();
521
539
  $: clientstylingurl && customStylingContainer && setClientStylingURL();
522
540
 
@@ -651,6 +669,7 @@
651
669
  <div class="CasinoGamesHeader" part="CasinoGamesHeader">
652
670
  <h3 class="CategoryName" part="CategoryName" bind:this={categoryName}>
653
671
  {$_('gamesCategorySection.favorites')}
672
+ <span class="CategoryFavName">({favoriteGamesData.items.length})</span>
654
673
  </h3>
655
674
  </div>
656
675
  <ul class="{(favoriteGamesData.items.length != 0) ? 'CasinoGamesGrid' : ''} 'GamesListIncreasedGap'}" part="{(favoriteGamesData.items.length != 0) ? 'CasinoGamesGrid' : ''} 'GamesListIncreasedGap'}" bind:this={container}>