@everymatrix/casino-search 1.5.3 → 1.5.5

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-search",
3
- "version": "1.5.3",
3
+ "version": "1.5.5",
4
4
  "main": "index.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": "455c9a0d14fef23d3698fbea37042c69e3aeed24"
39
+ "gitHead": "394176b807e2523b04e88d04cbdb5d596577547a"
40
40
  }
@@ -87,7 +87,7 @@
87
87
  let promises:Array<Promise<any>> = [];
88
88
  let index = 0;
89
89
  let length = recentSearchedGamesArray.length;
90
-
90
+
91
91
  if (length > 0) {
92
92
  for (index = 0; index < length; index++) {
93
93
  let url:any = new URL(`${endpoint}/casino/games/${recentSearchedGamesArray[index]}`);
@@ -100,6 +100,9 @@
100
100
  }
101
101
 
102
102
  Promise.all(promises).then((res:any):void => {
103
+ res = res.filter(function( element ) {
104
+ return !!element;
105
+ });
103
106
  searchArray = res.map((item) => {
104
107
  item.isFavorite = checkFavorite(item.id);
105
108
 
@@ -153,7 +156,9 @@
153
156
  .then(gameData => {
154
157
  isLoading = false;
155
158
 
156
- gamesCache[gameData[0].gameId] = gameData[0];
159
+ if(!gameData.error){
160
+ gamesCache[gameData[0].gameId] = gameData[0];
161
+ }
157
162
 
158
163
  resolve(gameData[0]);
159
164
  }).catch((err:any) => {
@@ -302,7 +307,7 @@
302
307
 
303
308
  getGames(searchUrl).then((searchData:any) => {
304
309
  searchArray = searchData.items.map((item) => {
305
- item.isFavorite = checkFavorite(item.id);
310
+ item.isFavorite = checkFavorite(item.id);
306
311
 
307
312
  return item;
308
313
  });