From efd3cae2ab57db2493ebf8223a42214dbe4d23f6 Mon Sep 17 00:00:00 2001 From: flashwave Date: Fri, 19 Jan 2024 14:15:09 +0000 Subject: [PATCH] Removed the ability to enable notifications when they are not supported. Safari for iOS was very cool and would get stuck on the loading screen if you did turn them on! --- src/mami.js/settings.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/mami.js/settings.js b/src/mami.js/settings.js index 0138601..1daeb42 100644 --- a/src/mami.js/settings.js +++ b/src/mami.js/settings.js @@ -361,12 +361,11 @@ const UmiSettings = { name: 'Show notifications', category: 'notification', type: 'checkbox', - mutable: true, + mutable: (() => 'Notification' in window)(), default: false, watcher: function(v, n, i) { - if(!v) return; - - if(Notification.permission === 'granted' && Notification.permission !== 'denied') + if(!v || !('Notification' in window) + || (Notification.permission === 'granted' && Notification.permission !== 'denied')) return; Notification.requestPermission() @@ -381,7 +380,7 @@ const UmiSettings = { name: 'Show contents of message', category: 'notification', type: 'checkbox', - mutable: true, + mutable: (() => 'Notification' in window)(), default: false, }, { @@ -389,7 +388,7 @@ const UmiSettings = { name: 'Triggers', category: 'notification', type: 'text', - mutable: true, + mutable: (() => 'Notification' in window)(), default: '', }, {