feat: rework multi account
This commit is contained in:
14
src/routes/_app.tsx
Normal file
14
src/routes/_app.tsx
Normal file
@@ -0,0 +1,14 @@
|
||||
import { commands } from '@/commands.gen'
|
||||
import { createFileRoute, redirect } from '@tanstack/react-router'
|
||||
|
||||
export const Route = createFileRoute('/_app')({
|
||||
beforeLoad: async () => {
|
||||
const accounts = await commands.getAccounts()
|
||||
|
||||
if (!accounts.length) {
|
||||
throw redirect({ to: '/new', replace: true })
|
||||
}
|
||||
|
||||
return { accounts }
|
||||
},
|
||||
})
|
||||
Reference in New Issue
Block a user