From 390d42c6076934a25205d5e3a98f1fd74de35ecd Mon Sep 17 00:00:00 2001 From: nimbleghost <132819643+nimbleghost@users.noreply.github.com> Date: Tue, 13 Jun 2023 14:02:54 +0200 Subject: [PATCH] Format & fix lint --- web/src/app/Api.js | 3 +-- web/src/app/Prefs.js | 4 ++-- web/src/app/SubscriptionManager.js | 5 ++--- web/src/app/UserManager.js | 4 ++-- web/src/app/db.js | 2 +- web/src/components/Preferences.jsx | 6 +++++- 6 files changed, 13 insertions(+), 11 deletions(-) diff --git a/web/src/app/Api.js b/web/src/app/Api.js index 8b7fc79b..afe59c7c 100644 --- a/web/src/app/Api.js +++ b/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, }), }); } diff --git a/web/src/app/Prefs.js b/web/src/app/Prefs.js index b4cef0ac..4826e061 100644 --- a/web/src/app/Prefs.js +++ b/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) { diff --git a/web/src/app/SubscriptionManager.js b/web/src/app/SubscriptionManager.js index b9e5d083..5b876ae1 100644 --- a/web/src/app/SubscriptionManager.js +++ b/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) { diff --git a/web/src/app/UserManager.js b/web/src/app/UserManager.js index 412e41da..b53b1da8 100644 --- a/web/src/app/UserManager.js +++ b/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() { diff --git a/web/src/app/db.js b/web/src/app/db.js index 357f4e96..77ac2562 100644 --- a/web/src/app/db.js +++ b/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; diff --git a/web/src/components/Preferences.jsx b/web/src/components/Preferences.jsx index 5a68a8ed..eeb6ee0c 100644 --- a/web/src/components/Preferences.jsx +++ b/web/src/components/Preferences.jsx @@ -247,7 +247,11 @@ const WebPushEnabled = () => { } return ( - +