Format & fix lint
parent
8ccfa5c3fb
commit
390d42c607
|
@ -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,
|
||||
}),
|
||||
});
|
||||
}
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import db from "./db";
|
||||
|
||||
class Prefs {
|
||||
constructor(db) {
|
||||
this.db = db;
|
||||
constructor(dbImpl) {
|
||||
this.db = dbImpl;
|
||||
}
|
||||
|
||||
async setSound(sound) {
|
||||
|
|
|
@ -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,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() {
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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>
|
||||
|
|
Loading…
Reference in New Issue