feat: save state when close app

This commit is contained in:
reya
2024-10-09 14:02:13 +07:00
parent e04497d841
commit 9f5b14956a
9 changed files with 52 additions and 37 deletions
@@ -29,7 +29,7 @@ function Screen() {
const updateSettings = () => {
startTransition(async () => {
const newSettings = JSON.stringify(appSettings.state);
const res = await commands.setSettings(newSettings);
const res = await commands.setUserSettings(newSettings);
if (res.status === "error") {
await message(res.error, { kind: "error" });
+1 -1
View File
@@ -4,7 +4,7 @@ import { createFileRoute } from "@tanstack/react-router";
export const Route = createFileRoute("/$account/_settings/general")({
beforeLoad: async () => {
const res = await commands.getSettings();
const res = await commands.getUserSettings();
if (res.status === "ok") {
appSettings.setState((state) => {