From 3f4bb0b1724f6c038f126567be12130351da3fa5 Mon Sep 17 00:00:00 2001 From: piotrpekala7 <31202938+piotrpekala7@users.noreply.github.com> Date: Fri, 10 Apr 2020 13:07:31 +0200 Subject: [PATCH] Update notification-box.component.ts --- .../notification-box/notification-box.component.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/app/components/notification-box/notification-box.component.ts b/src/app/components/notification-box/notification-box.component.ts index 86648a3e..83dfa3ca 100644 --- a/src/app/components/notification-box/notification-box.component.ts +++ b/src/app/components/notification-box/notification-box.component.ts @@ -39,7 +39,9 @@ export class NotificationBoxComponent implements OnInit, OnDestroy { ngOnInit() { let adbutler = localStorage.getItem('adbutler'); - if (!this.location.path().includes('nodes') && !(adbutler == 'true')) this.startTimer(); + var today = new Date().toISOString().substring(0, 10); + + if (!this.location.path().includes('nodes') && !(adbutler == today)) this.startTimer(); this.themeService.getActualTheme() === 'light' ? this.isLightThemeEnabled = true : this.isLightThemeEnabled = false; } @@ -80,7 +82,7 @@ export class NotificationBoxComponent implements OnInit, OnDestroy { } showNotification() { - localStorage.setItem('adbutler', 'true'); + localStorage.setItem('adbutler', new Date().toISOString().substring(0, 10)); this.viewTimer = timer(0, 100); this.progress = 0;