@everymatrix/casino-random-game 1.1.6 → 1.2.1

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-random-game",
3
- "version": "1.1.6",
3
+ "version": "1.2.1",
4
4
  "main": "dist/casino-random-game.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": "6ad785980b67f3b54da658b8df9f60190a10ffcc"
39
+ "gitHead": "de8b2a024255bd2ed76c13501c5a6dc858263dcb"
40
40
  }
@@ -14,6 +14,7 @@
14
14
  export let translationUrl:string = '';
15
15
  export let clientstyling:string = '';
16
16
  export let clientstylingurl:string = '';
17
+ export let filteredrandomgamecategories:string = '';
17
18
 
18
19
  let games:any = [];
19
20
  let randomGame:any = '';
@@ -41,18 +42,27 @@
41
42
  });
42
43
  }
43
44
 
44
-
45
45
  Object.keys(CasinoRandomGameTranslations).forEach((item:any) => {
46
46
  addNewMessages(item, CasinoRandomGameTranslations[item]);
47
47
  });
48
48
 
49
- const getRandomGame = (refresh?:boolean):void => {
49
+ const randomizeGame = () => {
50
50
  gamesToShow = shuffle(gamesToShow);
51
51
  offset = 0;
52
52
  count = 0;
53
53
  slotDone = false;
54
54
  randomGame = games[Math.floor(Math.random() * games.length)];
55
55
  show = true;
56
+ }
57
+
58
+ const getRandomGame = (refresh?:boolean):void => {
59
+ if(filteredrandomgamecategories){
60
+ do {
61
+ randomizeGame();
62
+ } while(!filteredrandomgamecategories.includes(randomGame.vendor.name));
63
+ } else {
64
+ randomizeGame();
65
+ }
56
66
 
57
67
  let interval = setInterval(() => {
58
68
  offset -= 100;