1
0
Fork 0
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:
nimbleghost 2023-06-13 14:02:54 +02:00
parent 8ccfa5c3fb
commit 390d42c607
6 changed files with 13 additions and 11 deletions

View file

@ -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,
}),
});
}

View file

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

View file

@ -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) {

View file

@ -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() {

View file

@ -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;

View file

@ -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>