1
0
Fork 0
mirror of https://github.com/binwiederhier/ntfy.git synced 2025-06-21 20:11:48 +02:00

Make web push toggle global

This commit is contained in:
nimbleghost 2023-06-08 09:22:56 +02:00
parent a8db08c7d4
commit 46798ac322
10 changed files with 99 additions and 91 deletions
web/src/app

View file

@ -114,6 +114,11 @@ class Notifier {
return this.pushSupported() && this.contextSupported() && this.granted() && !this.iosSupportedButInstallRequired();
}
async pushEnabled() {
const enabled = await prefs.webPushEnabled();
return this.pushPossible() && enabled;
}
/**
* Returns true if this is a HTTPS site, or served over localhost. Otherwise the Notification API
* is not supported, see https://developer.mozilla.org/en-US/docs/Web/API/notification