Merge pull request 'Remove auto-dismissing notifications' (#13) from sfr/pleroma-fe:develop into develop

Reviewed-on: AkkomaGang/pleroma-fe#13
This commit is contained in:
floatingghost 2022-06-24 15:47:48 +00:00
commit 9827c0e81e

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)
}