* wip: new sync * wip: restructure routes * update * feat: improve sync * feat: repost with multi-account * feat: improve sync * feat: publish with multi account * fix: settings screen * feat: add zap for multi accounts
18 lines
463 B
TypeScript
18 lines
463 B
TypeScript
import { commands } from '@/commands.gen'
|
|
import { appSettings } from '@/commons'
|
|
import { createFileRoute } from '@tanstack/react-router'
|
|
|
|
export const Route = createFileRoute('/settings/$id/general')({
|
|
beforeLoad: async () => {
|
|
const res = await commands.getUserSettings()
|
|
|
|
if (res.status === 'ok') {
|
|
appSettings.setState((state) => {
|
|
return { ...state, ...res.data }
|
|
})
|
|
} else {
|
|
throw new Error(res.error)
|
|
}
|
|
},
|
|
})
|