Remove auto-dismissing notifications
ci/woodpecker/pr/woodpecker Pipeline was successful Details

This commit is contained in:
Sol Fisher Romanoff 2022-06-23 22:31:30 +03:00
parent c71405ccad
commit f481cdd00b
Signed by untrusted user who does not match committer: nbsp
GPG Key ID: 9D3F2B64F2341B62
1 changed files with 1 additions and 4 deletions

View File

@ -2,8 +2,5 @@ export const showDesktopNotification = (rootState, desktopNotificationOpts) => {
if (!('Notification' in window && window.Notification.permission === 'granted')) return
if (rootState.statuses.notifications.desktopNotificationSilence) { return }
const desktopNotification = new window.Notification(desktopNotificationOpts.title, desktopNotificationOpts)
// Chrome is known for not closing notifications automatically
// according to MDN, anyway.
setTimeout(desktopNotification.close.bind(desktopNotification), 5000)
return new window.Notification(desktopNotificationOpts.title, desktopNotificationOpts)
}