From 024b6d52c35db02fd6cfa0e30c445ab2d8fc582b Mon Sep 17 00:00:00 2001 From: Dessalines Date: Sat, 4 Sep 2021 01:20:25 -0400 Subject: [PATCH] Fix issue with new notification trying to do a fetch. (#398) --- src/shared/utils.ts | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/src/shared/utils.ts b/src/shared/utils.ts index 86e513b3..f54e2592 100644 --- a/src/shared/utils.ts +++ b/src/shared/utils.ts @@ -686,18 +686,21 @@ export function notifyPrivateMessage(pmv: PrivateMessageView, router: any) { function notify(info: NotifyInfo, router: any) { messageToastify(info, router); - if (Notification.permission !== "granted") Notification.requestPermission(); - else { - var notification = new Notification(info.name, { - icon: info.icon, - body: info.body, - }); + // TODO absolute nightmare bug, but notifs are currently broken. + // Notification.new will try to do a browser fetch ??? - notification.onclick = (ev: Event): any => { - ev.preventDefault(); - router.history.push(info.link); - }; - } + // if (Notification.permission !== "granted") Notification.requestPermission(); + // else { + // var notification = new Notification(info.name, { + // icon: info.icon, + // body: info.body, + // }); + + // notification.onclick = (ev: Event): any => { + // ev.preventDefault(); + // router.history.push(info.link); + // }; + // } } export function setupTribute() {