mirror of
https://github.com/aljazceru/opencode.git
synced 2026-01-03 16:05:00 +01:00
wip: console
This commit is contained in:
@@ -24,8 +24,6 @@ function CopyStatus() {
|
||||
const isLoggedIn = query(async () => {
|
||||
"use server"
|
||||
const actor = await getActor()
|
||||
// TODO
|
||||
console.log(actor)
|
||||
if (actor.type === "account") {
|
||||
const workspaces = await withActor(() => Account.workspaces())
|
||||
return workspaces[0].id
|
||||
|
||||
@@ -22,8 +22,8 @@ const logout = action(async () => {
|
||||
const current = auth.data.current
|
||||
if (current)
|
||||
await auth.update((val) => {
|
||||
delete val.account[current]
|
||||
const first = Object.keys(val.account)[0]
|
||||
delete val.account?.[current]
|
||||
const first = Object.keys(val.account ?? {})[0]
|
||||
val.current = first
|
||||
return val
|
||||
})
|
||||
@@ -43,8 +43,10 @@ export default function WorkspaceLayout(props: RouteSectionProps) {
|
||||
</div>
|
||||
<div data-slot="header-actions">
|
||||
<span>{userInfo()?.user.email}</span>
|
||||
<form onSubmit={() => location.href = "/"} action={logout} method="post">
|
||||
<button type="submit" formaction={logout}>Logout</button>
|
||||
<form onSubmit={() => (location.href = "/")} action={logout} method="post">
|
||||
<button type="submit" formaction={logout}>
|
||||
Logout
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
Reference in New Issue
Block a user