adata-ui 0.1.62 → 0.1.65

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.62",
3
+ "version": "0.1.65",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve": "vue-cli-service serve",
@@ -237,11 +237,11 @@
237
237
  </div>
238
238
  </div>
239
239
  <div class="menu-mobile__info-footer">
240
- <div 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 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>
@@ -383,33 +383,40 @@ export default {
383
383
  },
384
384
  mounted() {
385
385
  this.setBalance(this.balance);
386
- this.timer = setTimeout(this.fetchNotification, 3000);
386
+ this.notificationShow()
387
387
  },
388
388
  watch: {
389
389
  balance(newBalance) {
390
390
  this.setBalance(newBalance);
391
391
  },
392
- isOpenNotification() {
393
- if(!this.isOpenNotification) {
394
- clearTimeout(this.timer);
395
- }
396
- }
397
392
  },
398
393
  methods: {
399
394
  async fetchNotification() {
400
395
  try {
401
- const response = await fetch('https://users.adtdev.kz/api/v1/system-messages/active-list/?module_name=counterparty');
396
+ const response = await fetch('https://users.adata.kz/api/v1/system-messages/active-list/?module_name=counterparty');
402
397
  const { data } = await response.json();
403
398
 
404
399
  if (data.details.length) {
405
400
  this.systemMessage = data.details[0].message;
406
401
  this.isOpenNotification = true;
402
+ localStorage.setItem('start_time', JSON.stringify(new Date()))
407
403
  }
408
404
 
409
405
  } catch(e) {
410
406
  console.log(e.message)
411
407
  }
412
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
+ },
413
420
  async fetchCurrencies() {
414
421
  try {
415
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">
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">
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>