feat: save state when close app
This commit is contained in:
@@ -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" });
|
||||
|
||||
@@ -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) => {
|
||||
|
||||
Reference in New Issue
Block a user