diff options
| author | Dax Raad <[email protected]> | 2025-09-03 13:10:57 -0400 |
|---|---|---|
| committer | Dax Raad <[email protected]> | 2025-09-03 13:10:57 -0400 |
| commit | 48a79b11738c3e55f25b49497b8ff78dfaee1222 (patch) | |
| tree | b5991665a2843c7edecd157c84bda5138ccd5d68 /cloud/app/src/routes/workspace.tsx | |
| parent | 59e550271d3c9bc50ebb8b7ba0d04eacd1e49e1a (diff) | |
| download | opencode-48a79b11738c3e55f25b49497b8ff78dfaee1222.tar.gz opencode-48a79b11738c3e55f25b49497b8ff78dfaee1222.zip | |
wip: make less shit
Diffstat (limited to 'cloud/app/src/routes/workspace.tsx')
| -rw-r--r-- | cloud/app/src/routes/workspace.tsx | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/cloud/app/src/routes/workspace.tsx b/cloud/app/src/routes/workspace.tsx index 853cb3707..791d22110 100644 --- a/cloud/app/src/routes/workspace.tsx +++ b/cloud/app/src/routes/workspace.tsx @@ -3,17 +3,17 @@ import { useAuthSession } from "~/context/auth.session" import { IconLogo } from "../component/icon" import { withActor } from "~/context/auth.withActor" import "./workspace.css" -import { query, action, redirect, createAsync, RouteSectionProps } from "@solidjs/router" +import { query, action, redirect, createAsync, RouteSectionProps, Navigate, useNavigate, useParams, A } from "@solidjs/router" import { User } from "@opencode/cloud-core/user.js" import { Actor } from "@opencode/cloud-core/actor.js" -const getUserInfo = query(async () => { +const getUserInfo = query(async (workspaceID: string) => { "use server" return withActor(async () => { const actor = Actor.assert("user") const user = await User.fromID(actor.properties.userID) return { user } - }) + }, workspaceID) }, "userInfo") const logout = action(async () => { @@ -30,16 +30,15 @@ const logout = action(async () => { }) export default function WorkspaceLayout(props: RouteSectionProps) { - const userInfo = createAsync(() => getUserInfo(), { - deferStream: true, - }) + const params = useParams() + const userInfo = createAsync(() => getUserInfo(params.id)) return ( <main data-page="workspace"> <header data-component="workspace-header"> <div data-slot="header-brand"> - <a href="/" data-component="site-title"> + <A href="/" data-component="site-title"> <IconLogo /> - </a> + </A> </div> <div data-slot="header-actions"> <span>{userInfo()?.user.email}</span> |
