Fix browser notification (#2261)

Signed-off-by: Denis Bykhov <80476319+BykhovDenis@users.noreply.github.com>
This commit is contained in:
Denis Bykhov 2022-08-27 13:53:37 +06:00 committed by GitHub
parent 849f94ef90
commit 99880588fb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -92,7 +92,7 @@
const setting = settings.get(notification.type)
const enabled = setting?.enabled ?? provider?.default
if (!enabled) return
if (setting?.modifiedOn ?? notification.modifiedOn < 0) return
if ((setting?.modifiedOn ?? notification.modifiedOn) < 0) return
if (Notification.permission === 'granted') {
await notify(text, notification)
} else if (Notification.permission !== 'denied') {
@ -105,7 +105,7 @@
async function notify (text: string, notification: PlatformNotification): Promise<void> {
const lastView = $lastViews.get(lastViewId)
if (lastView ?? notification.modifiedOn > 0) {
if ((lastView ?? notification.modifiedOn) > 0) {
// eslint-disable-next-line
new Notification(text, { tag: notification._id })
await notificationClient.updateLastView(