@everymatrix/casino-winners 1.2.1 → 1.3.0

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-winners",
3
- "version": "1.2.1",
3
+ "version": "1.3.0",
4
4
  "main": "dist/casino-winners.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": "de8b2a024255bd2ed76c13501c5a6dc858263dcb"
39
+ "gitHead": "ac0e71f6ea97bb7428ee75f5667c1408cbdc3146"
40
40
  }
@@ -8,6 +8,7 @@
8
8
 
9
9
  export let endpoint:string = '';
10
10
  export let session:string = '';
11
+ export let userid:string = '';
11
12
  export let periodrecent:string = 'Today';
12
13
  export let periodtop:string = 'Last7Days';
13
14
  export let numberusersrecent:string = '20';
@@ -17,11 +18,12 @@
17
18
  export let isrecentavailable:string = 'true';
18
19
  export let istopavailable:string = 'true';
19
20
  export let defaultcurrency:string = '';
21
+ export let usercurrency:string = '';
20
22
  export let clientstyling:string = '';
21
23
  export let clientstylingurl:string = '';
22
24
  export let enableautoscroll:string = "";
23
25
  export let tabsorder:string = '';
24
- export let translationUrl:string = '';
26
+ export let translationurl:string = '';
25
27
 
26
28
  const CARD_WRAPPER_WIDTH:number = 225;
27
29
 
@@ -33,9 +35,7 @@
33
35
  let userAgent:string = window.navigator.userAgent;
34
36
  let mobile:boolean;
35
37
  let isLoggedIn:boolean;
36
- let sessionID:string;
37
38
  let userId: string;
38
- let userCurrency:string;
39
39
  let customStylingContainer:HTMLElement;
40
40
  let displayNone:boolean = false;
41
41
  let isLoading:boolean = true;
@@ -46,7 +46,7 @@
46
46
  let currency:string;
47
47
 
48
48
  const setTranslationUrl = ():void => {
49
- let url:string = translationUrl;
49
+ let url:string = translationurl;
50
50
 
51
51
  fetch(url).then((res:any) => res.json())
52
52
  .then((res) => {
@@ -198,18 +198,14 @@
198
198
  }
199
199
 
200
200
  const setSession = ():void => {
201
- checkSession(endpoint, session).then((res:any) => {
202
- sessionID = res.Guid;
203
- userCurrency = res.Currency;
204
- userId = res.UserID;
205
- isLoggedIn = true;
206
- }, (err:any) => {
207
- isLoggedIn = false;
208
- });
201
+ isLoggedIn = true;
202
+ userId = userid;
203
+
204
+ setCurrency();
209
205
  }
210
206
 
211
207
  const setCurrency = ():void => {
212
- currency = isLoggedIn ? userCurrency : defaultcurrency;
208
+ currency = isLoggedIn ? usercurrency : defaultcurrency;
213
209
  }
214
210
 
215
211
  const setClientStyling = ():void => {
@@ -251,11 +247,11 @@
251
247
  }
252
248
  });
253
249
 
254
- $: isrecentavailable && istopavailable && periodrecent && periodtop && numberusersrecent && numberuserstop && amountlimit && lang && tabsorder && isLoggedIn != undefined && init();
255
- $: endpoint && setSession();
250
+ $: isrecentavailable && istopavailable && periodrecent && periodtop && numberusersrecent && numberuserstop && amountlimit && lang && tabsorder && init();
251
+ $: session && endpoint && setSession();
256
252
  $: endpoint && currency && enableautoscroll && getWinners();
257
253
  $: lang && setActiveLanguage();
258
- $: translationUrl && setTranslationUrl();
254
+ $: translationurl && setTranslationUrl();
259
255
  $: clientstyling && customStylingContainer && setClientStyling();
260
256
  $: clientstylingurl && customStylingContainer && setClientStylingURL();
261
257
 
@@ -304,7 +300,7 @@
304
300
  <p>{winner.gameName}</p>
305
301
  <p>{maskUsername(winner.username)}</p>
306
302
  <p class="WinnerUsername">{$_('Translations.won')}</p>
307
- <p>{winner.specifiedCurrencyAmount.toFixed(2)} <span>{isLoggedIn ? userCurrency : defaultcurrency}</span></p>
303
+ <p>{winner.specifiedCurrencyAmount.toFixed(2)} <span>{isLoggedIn ? usercurrency : defaultcurrency}</span></p>
308
304
  </div>
309
305
  </div>
310
306
  {/each}