1
0
Fork 0
mirror of https://github.com/binwiederhier/ntfy.git synced 2025-05-15 03:56:12 +02:00

Split out AccountApi

This commit is contained in:
binwiederhier 2022-12-25 11:59:44 -05:00
parent d4c7ad4beb
commit 276301dc87
11 changed files with 251 additions and 222 deletions
web/src/components

View file

@ -34,9 +34,9 @@ import DialogActions from "@mui/material/DialogActions";
import userManager from "../app/UserManager";
import {playSound, shuffle, sounds, validTopic, validUrl} from "../app/utils";
import {useTranslation} from "react-i18next";
import api, {UnauthorizedError} from "../app/Api";
import session from "../app/Session";
import routes from "./routes";
import accountApi, {UnauthorizedError} from "../app/AccountApi";
const Preferences = () => {
return (
@ -668,7 +668,7 @@ const maybeUpdateAccountSettings = async (payload) => {
return;
}
try {
await api.updateAccountSettings(config.baseUrl, session.token(), payload);
await accountApi.updateSettings(payload);
} catch (e) {
console.log(`[Preferences] Error updating account settings`, e);
if ((e instanceof UnauthorizedError)) {