aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/settings.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/settings.ts')
-rw-r--r--src/lib/settings.ts34
1 files changed, 17 insertions, 17 deletions
diff --git a/src/lib/settings.ts b/src/lib/settings.ts
index 6f4d3f62..a3b875c0 100644
--- a/src/lib/settings.ts
+++ b/src/lib/settings.ts
@@ -2,28 +2,28 @@ import { auth, fd, post } from "$lib/utils";
import { fail } from "@sveltejs/kit";
type Error = {
- message: string;
+ message: string;
};
export default async ({ cookies, request }) => {
- const form = await fd(request);
+ const form = await fd(request);
- if (form.tab === "account") {
- form.notify = form.notify === "on";
- form.push = form.push === "on";
- form.nip5 = form.nip5 === "on";
- form.prompt = form.prompt === "on";
- form.autowithdraw = form.autowithdraw === "on";
- }
+ if (form.tab === "account") {
+ form.notify = form.notify === "on";
+ form.push = form.push === "on";
+ form.nip5 = form.nip5 === "on";
+ form.prompt = form.prompt === "on";
+ form.autowithdraw = form.autowithdraw === "on";
+ }
- try {
- const { user } = await post("/user", form, auth(cookies));
+ try {
+ const { user } = await post("/user", form, auth(cookies));
- if (user.language) cookies.set("lang", user.language, { path: "/" });
+ if (user.language) cookies.set("lang", user.language, { path: "/" });
- return { user, success: true };
- } catch (e) {
- const { message } = e as Error;
- return fail(400, { message });
- }
+ return { user, success: true };
+ } catch (e) {
+ const { message } = e as Error;
+ return fail(400, { message });
+ }
};