adata-ui 0.1.62 → 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/dist/adata-ui.common.js +90 -26
- package/dist/adata-ui.common.js.map +1 -1
- package/dist/adata-ui.umd.js +90 -26
- package/dist/adata-ui.umd.js.map +1 -1
- package/dist/adata-ui.umd.min.js +2 -2
- package/dist/adata-ui.umd.min.js.map +1 -1
- package/package-lock.json +1 -1
- package/package.json +1 -1
- package/src/components/Header/Header.vue +13 -6
package/package-lock.json
CHANGED
package/package.json
CHANGED
|
@@ -383,17 +383,12 @@ export default {
|
|
|
383
383
|
},
|
|
384
384
|
mounted() {
|
|
385
385
|
this.setBalance(this.balance);
|
|
386
|
-
this.
|
|
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() {
|
|
@@ -404,12 +399,24 @@ export default {
|
|
|
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');
|