Fix issue with new notification trying to do a fetch. (#398)

This commit is contained in:
Dessalines 2021-09-04 01:20:25 -04:00 committed by GitHub
parent 11b8171fde
commit a19c84c03e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View 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,
});
// 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() {