mirror of
https://github.com/LemmyNet/lemmy-ui.git
synced 2025-01-23 14:23:08 +00:00
Fix Notification browser fetch
This commit is contained in:
parent
501a5fb1e7
commit
982fae53c8
1 changed files with 11 additions and 14 deletions
|
@ -686,21 +686,18 @@ export function notifyPrivateMessage(pmv: PrivateMessageView, router: any) {
|
|||
function notify(info: NotifyInfo, router: any) {
|
||||
messageToastify(info, router);
|
||||
|
||||
// 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, {
|
||||
...{body: info.body},
|
||||
...(info.icon && {icon: info.icon})
|
||||
});
|
||||
|
||||
// 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);
|
||||
// };
|
||||
// }
|
||||
notification.onclick = (ev: Event): any => {
|
||||
ev.preventDefault();
|
||||
router.history.push(info.link);
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export function setupTribute() {
|
||||
|
|
Loading…
Add table
Reference in a new issue