@everymatrix/casino-categories 0.0.410 → 0.0.412

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/index.html CHANGED
@@ -92,6 +92,7 @@
92
92
  endpoint="https://demo-api.stage.norway.everymatrix.com/v2/"
93
93
  datasource="RNG"
94
94
  activecategory="RNG$popular-games"
95
+ excludedflags="vendor, collection"
95
96
  ></casino-categories>
96
97
  </body>
97
98
  </html>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@everymatrix/casino-categories",
3
- "version": "0.0.410",
3
+ "version": "0.0.412",
4
4
  "main": "dist/casino-categories.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": "1382b42c7640e087088ead5f06ab6ae8d99f0668"
39
+ "gitHead": "915e53c91820558c3cedd66aa2fa8a4343a6d67b"
40
40
  }
@@ -7,6 +7,7 @@
7
7
  export let datasource:string = '';
8
8
  export let lang:string = 'en';
9
9
  export let activecategory:string = '';
10
+ export let excludedflags:string = '';
10
11
  export let clientstyling:string = '';
11
12
  export let clientstylingurl:string = '';
12
13
 
@@ -32,11 +33,15 @@
32
33
  .then((res:any) => res.json())
33
34
  .then((data:any) => {
34
35
  isLoading = false;
36
+ const excludedFlagsArray = excludedflags.split(',').map(flag => flag.trim());
35
37
 
36
38
  categories.push(...data.items)
37
39
 
38
- topCategories = categories.filter(category => category.isTopCategory === true)
39
- otherCategories = categories.filter(category => category.isTopCategory === false)
40
+ // remove those items which have a flag matching the excluded flags
41
+ const itemsAfterFlagExclusion = categories.filter((item) => !excludedFlagsArray.some(flag => item.flags?.indexOf(flag) >= 0));
42
+
43
+ topCategories = itemsAfterFlagExclusion.filter(category => category.isTopCategory === true)
44
+ otherCategories = itemsAfterFlagExclusion.filter(category => category.isTopCategory === false)
40
45
  });
41
46
  }
42
47