@everymatrix/casino-games-category-section 0.0.273 → 0.0.276

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.273",
3
+ "version": "0.0.276",
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": "64e123e6fa8a75c569b58741b32113413ad65748"
39
+ "gitHead": "ec7626d4a812ba6dab87966c1468ea44a9a4ea9d"
40
40
  }
@@ -393,10 +393,17 @@
393
393
  getData(categoryId, offset, limit).then((res:any) => {
394
394
  categoryData = res;
395
395
  // @TODO categoryData type fix
396
- shownCategoryData = categoryData.games.items;
397
- shownCategoryData.forEach((item:any) => {
398
- item.isFavorite = checkFavorite(item.id);
399
- });
396
+ /**
397
+ * This check is needed to prevent requests with less items
398
+ * that started before but ended after the last request to add items to list
399
+ * This could also use abort controller instead but refactoring is needed
400
+ */
401
+ if(categoryData.games.items.length > shownCategoryData.length){
402
+ shownCategoryData = categoryData.games.items;
403
+ shownCategoryData.forEach((item:any) => {
404
+ item.isFavorite = checkFavorite(item.id);
405
+ });
406
+ }
400
407
  });
401
408
  }
402
409
  }