Send notifications also when the tab is not visible

This commit is contained in:
Michcio 2022-09-23 11:59:54 +02:00
parent e44be45c90
commit ed515cc24c

View file

@ -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');
};