Reverse if condition

This commit is contained in:
Eduard Urbach 2018-03-20 18:29:10 +01:00
parent 24b0036617
commit 2dae63412f

View File

@ -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