Correctly handle standalone (PWA) mode changes

- Also handle notification permission changes
- Remove web push schedule worker since this complicates
  things and doesn’t do _that_ much. We have the reminder
  notification if the user truly doesn’t reload ntfy in
  more than a week.
This commit is contained in:
nimbleghost
2023-06-25 21:25:30 +02:00
parent 532fd3c560
commit a8d3297c4e
6 changed files with 91 additions and 90 deletions

View File

@@ -1,5 +1,4 @@
import db from "./db";
import { isLaunchedPWA } from "./utils";
class Prefs {
constructor(dbImpl) {
@@ -35,7 +34,7 @@ class Prefs {
async webPushEnabled() {
const webPushEnabled = await this.db.prefs.get("webPushEnabled");
return webPushEnabled?.value ?? isLaunchedPWA();
return webPushEnabled?.value;
}
async setWebPushEnabled(enabled) {