mirror of
https://github.com/binwiederhier/ntfy.git
synced 2024-11-26 13:19:15 +01:00
Format & fix lint
This commit is contained in:
parent
8ccfa5c3fb
commit
390d42c607
6 changed files with 13 additions and 11 deletions
|
@ -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 a new issue