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:
Penar Musaraj 2021-11-08 13:04:43 -05:00 committed by GitHub
parent 5355990b2c
commit e0ced68eec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -177,18 +177,10 @@ function onNotification(data, siteSettings, user) {
tag: notificationTag,
});
function clickEventHandler() {
notification.onclick = () => {
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.removeEventListener("click", clickEventHandler);
}, 10 * 1000);
};
});
}