From 11a01b95bb2ff97d2bfdccfee07749c69e896011 Mon Sep 17 00:00:00 2001 From: Cyber Majeed <73933962+cybermajeed@users.noreply.github.com> Date: Wed, 27 Sep 2023 12:55:42 +0400 Subject: [PATCH] Add files via upload --- index.js | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/index.js b/index.js index 37dfb51..3fd1a04 100644 --- a/index.js +++ b/index.js @@ -128,9 +128,9 @@ function showNotification(periodNum, today) { window.open(location.href, "_blank"); }; } -Notification.requestPermission().then((permission) => { - if (permission == "granted") { - setInterval(() => { +setInterval(() => { + Notification.requestPermission().then((permission) => { + if (permission == "granted") { let hour = new Date().getHours(), mins = new Date().getMinutes(), secs = new Date().getSeconds(), @@ -201,10 +201,9 @@ Notification.requestPermission().then((permission) => { showNotification(1, days[today]); } } - }, 500); - } else if (permission == "denied") { - alert("Notification Blocked"); - } -}); - + } else if (permission == "denied") { + alert("Notification Blocked"); + } + }); +}, 500); //notify ends