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!
This commit is contained in:
flash 2024-01-19 14:15:09 +00:00
parent 55f3fd87fc
commit efd3cae2ab

View file

@ -361,12 +361,11 @@ const UmiSettings = {
name: 'Show notifications', name: 'Show notifications',
category: 'notification', category: 'notification',
type: 'checkbox', type: 'checkbox',
mutable: true, mutable: (() => 'Notification' in window)(),
default: false, default: false,
watcher: function(v, n, i) { watcher: function(v, n, i) {
if(!v) return; if(!v || !('Notification' in window)
|| (Notification.permission === 'granted' && Notification.permission !== 'denied'))
if(Notification.permission === 'granted' && Notification.permission !== 'denied')
return; return;
Notification.requestPermission() Notification.requestPermission()
@ -381,7 +380,7 @@ const UmiSettings = {
name: 'Show contents of message', name: 'Show contents of message',
category: 'notification', category: 'notification',
type: 'checkbox', type: 'checkbox',
mutable: true, mutable: (() => 'Notification' in window)(),
default: false, default: false,
}, },
{ {
@ -389,7 +388,7 @@ const UmiSettings = {
name: 'Triggers', name: 'Triggers',
category: 'notification', category: 'notification',
type: 'text', type: 'text',
mutable: true, mutable: (() => 'Notification' in window)(),
default: '', default: '',
}, },
{ {