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
No known key found for this signature in database
GPG key ID: A1DC0CFB5615D905
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();