From 2dae63412f3a567bcc42af5e3e0d44fac14f4ed7 Mon Sep 17 00:00:00 2001 From: Eduard Urbach Date: Tue, 20 Mar 2018 18:29:10 +0100 Subject: [PATCH] Reverse if condition --- scripts/Actions/Notifications.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/Actions/Notifications.ts b/scripts/Actions/Notifications.ts index eeb9122c..1712eecd 100644 --- a/scripts/Actions/Notifications.ts +++ b/scripts/Actions/Notifications.ts @@ -30,15 +30,15 @@ export async function markNotificationsAsSeen(arn: AnimeNotifier) { }) // Update notification counter - if(!("serviceWorker" in navigator)) { - // If there is no service worker, update the counter on this tab - arn.notificationManager.update() - } else { + if("serviceWorker" in navigator) { // If we have service worker support, broadcast the "notifications marked as seen" message to all open tabs arn.serviceWorkerManager.postMessage({ type: "broadcast", realType: "notifications marked as seen" }) + } else { + // If there is no service worker, update the counter on this tab + arn.notificationManager.update() } // Update notifications