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:
Pachira 2024-01-19 14:15:09 +00:00
parent 55f3fd87fc
commit efd3cae2ab

View file

@ -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: '',
},
{