mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:22:12 +08:00
FIX: Persist notifications in OS X (#14843)
We were previously triggering the close event, which in OSX meant that notifications would disappear from Notification Center.
This commit is contained in:
parent
5355990b2c
commit
e0ced68eec
@ -177,18 +177,10 @@ function onNotification(data, siteSettings, user) {
|
|||||||
tag: notificationTag,
|
tag: notificationTag,
|
||||||
});
|
});
|
||||||
|
|
||||||
function clickEventHandler() {
|
notification.onclick = () => {
|
||||||
DiscourseURL.routeTo(data.post_url);
|
DiscourseURL.routeTo(data.post_url);
|
||||||
// Cannot delay this until the page renders
|
|
||||||
// due to trigger-based permissions
|
|
||||||
window.focus();
|
|
||||||
}
|
|
||||||
|
|
||||||
notification.addEventListener("click", clickEventHandler);
|
|
||||||
later(() => {
|
|
||||||
notification.close();
|
notification.close();
|
||||||
notification.removeEventListener("click", clickEventHandler);
|
};
|
||||||
}, 10 * 1000);
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user