adata-ui 0.1.60 → 0.1.64

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.60",
3
+ "version": "0.1.64",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve": "vue-cli-service serve",
@@ -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" v-show="requestCount === 0 || requestCount">
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" v-show="daysRemaining === 0 || daysRemaining">
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');
@@ -131,11 +131,11 @@
131
131
  </div>
132
132
  <div v-if="isAuthenticated" class="info-header__item">
133
133
  <div class="info-header__item-elem">
134
- <div class="info-header__inner-item" v-show="requestCount">
134
+ <div class="info-header__inner-item" v-show="requestCount === 0 || requestCount">
135
135
  <span class="info-header__title">Суточный лимит запросов</span>
136
136
  <span class="info-header__result info-header__result_circled">{{ requestCount }}</span>
137
137
  </div>
138
- <div class="info-header__inner-item" v-show="daysRemaining">
138
+ <div class="info-header__inner-item" v-show="daysRemaining === 0 || daysRemaining">
139
139
  <span class="info-header__title">остаток дней</span>
140
140
  <span class="info-header__result info-header__result_circled">{{ daysRemaining }}</span>
141
141
  </div>