1
0
Fork 0
mirror of https://github.com/binwiederhier/ntfy.git synced 2025-07-08 03:54:43 +02:00

More refactor

This commit is contained in:
binwiederhier 2023-06-08 23:09:38 -04:00
parent 9d38aeb863
commit 966ffe1669
8 changed files with 110 additions and 130 deletions
web/src/app

View file

@ -58,7 +58,7 @@ class Notifier {
return existingSubscription;
}
// Create a new subscription only if web push is enabled.
// Create a new subscription only if web push is enabled.
// It is possible that web push was previously enabled and then disabled again
// in which case there would be an existingSubscription.
// but if it was _not_ enabled previously, we reach here, and only create a new
@ -76,11 +76,9 @@ class Notifier {
async pushManager() {
const registration = await navigator.serviceWorker.getRegistration();
if (!registration) {
throw new Error("No service worker registration found");
}
return registration.pushManager;
}