mirror of
https://github.com/LemmyNet/lemmy-ui.git
synced 2024-11-22 20:31:13 +00:00
Merge branch 'fix/notif_new_fetch_bug' of https://github.com/ernestwisniewski/lemmy-ui into notif_bug
This commit is contained in:
commit
cc90ded31e
1 changed files with 11 additions and 14 deletions
|
@ -630,21 +630,18 @@ export function notifyPrivateMessage(pmv: PrivateMessageView, router: any) {
|
||||||
function notify(info: NotifyInfo, router: any) {
|
function notify(info: NotifyInfo, router: any) {
|
||||||
messageToastify(info, router);
|
messageToastify(info, router);
|
||||||
|
|
||||||
// TODO absolute nightmare bug, but notifs are currently broken.
|
if (Notification.permission !== "granted") Notification.requestPermission();
|
||||||
// Notification.new will try to do a browser fetch ???
|
else {
|
||||||
|
var notification = new Notification(info.name, {
|
||||||
|
...{ body: info.body },
|
||||||
|
...(info.icon.isSome() && { icon: info.icon.unwrap() }),
|
||||||
|
});
|
||||||
|
|
||||||
// if (Notification.permission !== "granted") Notification.requestPermission();
|
notification.onclick = (ev: Event): any => {
|
||||||
// else {
|
ev.preventDefault();
|
||||||
// var notification = new Notification(info.name, {
|
router.history.push(info.link);
|
||||||
// icon: info.icon,
|
};
|
||||||
// body: info.body,
|
}
|
||||||
// });
|
|
||||||
|
|
||||||
// notification.onclick = (ev: Event): any => {
|
|
||||||
// ev.preventDefault();
|
|
||||||
// router.history.push(info.link);
|
|
||||||
// };
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export function setupTribute() {
|
export function setupTribute() {
|
||||||
|
|
Loading…
Reference in a new issue