adata-ui 0.1.59 → 0.1.63

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-lock.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "adata-ui",
3
- "version": "0.1.45",
3
+ "version": "0.1.62",
4
4
  "lockfileVersion": 1,
5
5
  "requires": true,
6
6
  "dependencies": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "adata-ui",
3
- "version": "0.1.59",
3
+ "version": "0.1.63",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve": "vue-cli-service serve",
@@ -139,11 +139,11 @@ export default {
139
139
  color: #333333;
140
140
 
141
141
  &:hover {
142
- background: linear-gradient(236.46deg, #FFE364 -2.39%, #FBC920 79.1%);
142
+ background: #FBC920;
143
143
  }
144
144
 
145
145
  &:active {
146
- background: linear-gradient(236.46deg, #FFE364 -2.39%, #FBC920 79.1%);
146
+ background: #FBC920;
147
147
  }
148
148
  }
149
149
 
@@ -27,7 +27,7 @@
27
27
  ></path>
28
28
  </svg>
29
29
  </a>
30
- <div class="menu" v-if="headerItems.length > 0">
30
+ <div class="menu" v-show="headerItems.length > 0">
31
31
  <a
32
32
  v-for="(item, index) in headerItems"
33
33
  :key="index"
@@ -39,7 +39,7 @@
39
39
  </a>
40
40
  </div>
41
41
  </div>
42
- <div class="header__right">
42
+ <div class="header__right" v-show="!noAuth">
43
43
  <slot name="chooseCountry"></slot>
44
44
  <Profile
45
45
  :profileDropDown="profileDropDown"
@@ -237,11 +237,11 @@
237
237
  </div>
238
238
  </div>
239
239
  <div class="menu-mobile__info-footer">
240
- <div v-if="requestCount" class="menu-mobile__info-footer-item">
240
+ <div class="menu-mobile__info-footer-item">
241
241
  <span class="menu-mobile__info-footer-title">Суточный лимит запросов:</span>
242
242
  <span class="menu-mobile__info-footer-circle">{{ requestCount }}</span>
243
243
  </div>
244
- <div v-if="daysRemaining" class="menu-mobile__info-footer-item">
244
+ <div class="menu-mobile__info-footer-item">
245
245
  <span class="menu-mobile__info-footer-title">Остаток дней:</span>
246
246
  <span class="menu-mobile__info-footer-circle">{{ daysRemaining }}</span>
247
247
  </div>
@@ -275,6 +275,10 @@ export default {
275
275
  return ["prod", "dev", "staging"].indexOf(value) !== -1;
276
276
  },
277
277
  },
278
+ noAuth: {
279
+ type: Boolean,
280
+ default: false
281
+ },
278
282
  isAuthenticated: {
279
283
  type: Boolean,
280
284
  default: false,
@@ -379,17 +383,12 @@ export default {
379
383
  },
380
384
  mounted() {
381
385
  this.setBalance(this.balance);
382
- this.timer = setTimeout(this.fetchNotification, 3000);
386
+ this.notificationShow()
383
387
  },
384
388
  watch: {
385
389
  balance(newBalance) {
386
390
  this.setBalance(newBalance);
387
391
  },
388
- isOpenNotification() {
389
- if(!this.isOpenNotification) {
390
- clearTimeout(this.timer);
391
- }
392
- }
393
392
  },
394
393
  methods: {
395
394
  async fetchNotification() {
@@ -400,12 +399,24 @@ export default {
400
399
  if (data.details.length) {
401
400
  this.systemMessage = data.details[0].message;
402
401
  this.isOpenNotification = true;
402
+ localStorage.setItem('start_time', JSON.stringify(new Date()))
403
403
  }
404
404
 
405
405
  } catch(e) {
406
406
  console.log(e.message)
407
407
  }
408
408
  },
409
+ notificationShow() {
410
+ const startTime = localStorage.getItem('start_time');
411
+ let diffTime = startTime ? Math.round((new Date() - new Date(JSON.parse(startTime))) / 3600000): 0
412
+ if (startTime) {
413
+ if (diffTime >= 24) {
414
+ localStorage.removeItem('start_time')
415
+ }
416
+ } else {
417
+ this.fetchNotification()
418
+ }
419
+ },
409
420
  async fetchCurrencies() {
410
421
  try {
411
422
  const response = await fetch('https://users.adata.kz/api/v1/information/currency');