wip: refactor

This commit is contained in:
2024-02-17 16:01:53 +07:00
parent f47eba5af7
commit 0f06522c28
18 changed files with 168 additions and 525 deletions

View File

@@ -1,19 +1,19 @@
import { createFileRoute, redirect } from "@tanstack/react-router";
import { invoke } from "@tauri-apps/api/core";
export const Route = createFileRoute("/")({
beforeLoad: async ({ location }) => {
const signer = await invoke("verify_signer");
if (!signer) {
throw redirect({
to: "/landing",
search: {
redirect: location.href,
},
});
}
throw redirect({
to: "/app/space",
});
},
beforeLoad: async ({ location, context }) => {
const ark = context.ark;
const signer = await ark.verify_signer();
if (!signer) {
throw redirect({
to: "/landing",
search: {
redirect: location.href,
},
});
}
throw redirect({
to: "/app/space",
});
},
});