Update notification counter of all clients on push
This commit is contained in:
@ -17,9 +17,6 @@ export async function testNotification(arn: AnimeNotifier) {
|
||||
await fetch("/api/test/notification", {
|
||||
credentials: "same-origin"
|
||||
})
|
||||
|
||||
// Update notification counter
|
||||
arn.notificationManager.update()
|
||||
}
|
||||
|
||||
// Mark notifications as seen
|
||||
|
@ -73,6 +73,10 @@ export class ServiceWorkerManager {
|
||||
let message = JSON.parse(evt.data)
|
||||
|
||||
switch(message.type) {
|
||||
case "new notification":
|
||||
this.arn.notificationManager.update()
|
||||
break
|
||||
|
||||
case "new content":
|
||||
if(message.url.includes("/_/")) {
|
||||
// Content reload
|
||||
|
Reference in New Issue
Block a user