wip: migrate to desktop2
This commit is contained in:
25
apps/desktop2/src/routes/index.tsx
Normal file
25
apps/desktop2/src/routes/index.tsx
Normal file
@@ -0,0 +1,25 @@
|
||||
import { createFileRoute, redirect } from "@tanstack/react-router";
|
||||
import { invoke } from "@tauri-apps/api/core";
|
||||
|
||||
export const Route = createFileRoute("/")({
|
||||
component: Index,
|
||||
beforeLoad: async ({ location }) => {
|
||||
const signer = await invoke("verify_signer");
|
||||
if (!signer) {
|
||||
throw redirect({
|
||||
to: "/landing",
|
||||
search: {
|
||||
redirect: location.href,
|
||||
},
|
||||
});
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
function Index() {
|
||||
return (
|
||||
<div className="p-2">
|
||||
<h3>Welcome Home!</h3>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user