nimbleghost před 2 roky
rodič
revize
390d42c607

+ 1 - 2
web/src/app/Api.js

@@ -132,7 +132,6 @@ class Api {
     });
   }
 
-
   async deleteWebPush(pushSubscription) {
     const user = await userManager.get(config.base_url);
     const url = accountWebPushUrl(config.base_url);
@@ -141,7 +140,7 @@ class Api {
       method: "DELETE",
       headers: maybeWithAuth({}, user),
       body: JSON.stringify({
-        endpoint: pushSubscription.endpoint
+        endpoint: pushSubscription.endpoint,
       }),
     });
   }

+ 2 - 2
web/src/app/Prefs.js

@@ -1,8 +1,8 @@
 import db from "./db";
 
 class Prefs {
-  constructor(db) {
-    this.db = db;
+  constructor(dbImpl) {
+    this.db = dbImpl;
   }
 
   async setSound(sound) {

+ 2 - 3
web/src/app/SubscriptionManager.js

@@ -5,8 +5,8 @@ import db from "./db";
 import { topicUrl } from "./utils";
 
 class SubscriptionManager {
-  constructor(db) {
-    this.db = db;
+  constructor(dbImpl) {
+    this.db = dbImpl;
   }
 
   /** All subscriptions, including "new count"; this is a JOIN, see https://dexie.org/docs/API-Reference#joining */
@@ -124,7 +124,6 @@ class SubscriptionManager {
     } else {
       await api.deleteWebPush(browserSubscription);
     }
-
   }
 
   async updateState(subscriptionId, state) {

+ 2 - 2
web/src/app/UserManager.js

@@ -2,8 +2,8 @@ import db from "./db";
 import session from "./Session";
 
 class UserManager {
-  constructor(db) {
-    this.db = db;
+  constructor(dbImpl) {
+    this.db = dbImpl;
   }
 
   async all() {

+ 1 - 1
web/src/app/db.js

@@ -26,6 +26,6 @@ export const dbAsync = async () => {
   return createDatabase(username);
 };
 
-export const db = () => createDatabase(session.username());
+const db = () => createDatabase(session.username());
 
 export default db;

+ 5 - 1
web/src/components/Preferences.jsx

@@ -247,7 +247,11 @@ const WebPushEnabled = () => {
   }
 
   return (
-    <Pref labelId={labelId} title={t("prefs_notifications_web_push_title")} description={enabled ? t("prefs_notifications_web_push_enabled_description") : t("prefs_notifications_web_push_disabled_description")}>
+    <Pref
+      labelId={labelId}
+      title={t("prefs_notifications_web_push_title")}
+      description={enabled ? t("prefs_notifications_web_push_enabled_description") : t("prefs_notifications_web_push_disabled_description")}
+    >
       <FormControl fullWidth variant="standard" sx={{ m: 1 }}>
         <Select value={enabled ?? false} onChange={handleChange} aria-labelledby={labelId}>
           <MenuItem value>{t("prefs_notifications_web_push_enabled")}</MenuItem>