forked from FoundKeyGang/FoundKey
Send notifications also when the tab is not visible
This commit is contained in:
parent
e44be45c90
commit
ed515cc24c
1 changed files with 48 additions and 54 deletions
|
@ -36,11 +36,6 @@ const dev: Ref<boolean> = ref(_DEV_);
|
|||
const onNotification = (notification: foundkey.entities.Notification): void => {
|
||||
if ($i?.mutingNotificationTypes.includes(notification.type)) return;
|
||||
|
||||
if (document.visibilityState === 'visible') {
|
||||
stream.send('readNotification', {
|
||||
id: notification.id,
|
||||
});
|
||||
|
||||
if (notification.type !== 'app') {
|
||||
const user = notification.user;
|
||||
const userName = acct(user);
|
||||
|
@ -89,8 +84,7 @@ const onNotification = (notification: foundkey.entities.Notification): void => {
|
|||
icon: instance.iconUrl,
|
||||
// TODO: timestamp?
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
sound.play('notification');
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue