]> Untitled Git - lemmy-ui.git/commitdiff
Fix issue with new notification trying to do a fetch. (#398)
authorDessalines <dessalines@users.noreply.github.com>
Sat, 4 Sep 2021 05:20:25 +0000 (01:20 -0400)
committerGitHub <noreply@github.com>
Sat, 4 Sep 2021 05:20:25 +0000 (01:20 -0400)
src/shared/utils.ts

index 86e513b3f0011bc45cb5d47a686bf7f80af2e2a3..f54e2592d0c4797399a889c48815ea6412d1150d 100644 (file)
@@ -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,
-    });
-
-    notification.onclick = (ev: Event): any => {
-      ev.preventDefault();
-      router.history.push(info.link);
-    };
-  }
+  // TODO absolute nightmare bug, but notifs are currently broken.
+  // Notification.new will try to do a browser fetch ???
+
+  // 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() {