@everymatrix/general-player-register-form-step2 0.0.240 → 0.0.241

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/general-player-register-form-step2",
3
- "version": "0.0.240",
3
+ "version": "0.0.241",
4
4
  "main": "dist/general-player-register-form-step2.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": "6b0a5bd921101009e1bbfaa3fe63215a87fffc40"
39
+ "gitHead": "298253a66c9a5be49e9c3c631b327129dc84c541"
40
40
  }
@@ -30,7 +30,8 @@
30
30
  let minDate:number;
31
31
  let maxDate:number;
32
32
 
33
- let isValid:Boolean = false;
33
+ let isValid:boolean = false;
34
+ let isLoading:boolean = true;
34
35
 
35
36
  // setupI18n({ withLocale: 'en', translations: {}});
36
37
 
@@ -38,28 +39,32 @@
38
39
  addNewMessages(item, RegisterFormStep2Translations[item]);
39
40
  });
40
41
 
41
- const createYearsArray = () => {
42
- maxDate = parseInt(moment(currentDate.setDate(currentDate.getDate())).subtract(parseInt(licenseyears), 'y').format('YYYY'));
43
- minDate = parseInt(moment(currentDate.setDate(currentDate.getDate())).subtract(100 + parseInt(licenseyears), 'y').format('YYYY'));
42
+ const createYearsArray = ():void => {
43
+ maxDate = parseInt(moment(currentDate.setDate(currentDate.getDate())).subtract(parseInt(licenseyears, 10), 'y').format('YYYY'));
44
+ minDate = parseInt(moment(currentDate.setDate(currentDate.getDate())).subtract(100 + parseInt(licenseyears, 10), 'y').format('YYYY'));
44
45
 
45
- for(let i=maxDate; i>=minDate; i--) {
46
+ for (let i = maxDate; i >= minDate; i--) {
46
47
  birthYears.push(i);
47
48
  }
49
+
50
+ isLoading = false;
48
51
  }
49
52
 
50
- const getCurrencies = () => {
53
+ const getCurrencies = ():void => {
51
54
  fetch(`${endpoint}/player/operatorSupportedCurrencies`)
52
55
  .then((res:any) => res.json())
53
56
  .then(data => {
54
57
  currencies = data.currencies;
58
+
55
59
  if (!currencySelected) {
56
60
  currencySelected = currencies[0];
57
61
  }
58
62
  });
59
63
  }
60
64
 
61
- const checkIsValid = () => {
65
+ const checkIsValid = ():void => {
62
66
  isValid = !(invalidFirstName || invalidLastName || invalidBirthPlace);
67
+
63
68
  if (userFirstName.length <= 0 || userLastName.length <= 0 || birthPlace.length <= 0 || !userTitleSelected || !birthDaySelected || !birthMonthSelected || !birthYearSelected) {
64
69
  isValid = false;
65
70
  }
@@ -216,9 +221,11 @@
216
221
  </select>
217
222
  <select bind:value={birthYearSelected} on:blur={checkIsValid} class="BirthYearSelected">
218
223
  <option value="" disabled selected>{$_('registerFormStep2.registerBirthYear')}</option>
219
- {#each birthYears as birthYear}
220
- <option value={birthYear}>{birthYear}</option>
221
- {/each}
224
+ {#if !isLoading}
225
+ {#each birthYears as birthYear}
226
+ <option value={birthYear}>{birthYear}</option>
227
+ {/each}
228
+ {/if}
222
229
  </select>
223
230
  </div>
224
231
  </div>