Fix errors on setups with no Notifications/SpeechSynthesis support

This commit is contained in:
Vendicated
2023-04-17 00:21:49 +02:00
parent cb3bd4b881
commit ca5d24385f
3 changed files with 33 additions and 22 deletions

View File

@ -77,6 +77,8 @@ function _showNotification(notification: NotificationData, id: number) {
}
function shouldBeNative() {
if (typeof Notification === "undefined") return false;
const { useNative } = Settings.notifications;
if (useNative === "always") return true;
if (useNative === "not-focused") return !document.hasFocus();