ignore: cloud
This commit is contained in:
parent
3f225e3248
commit
f97fdceb01
1 changed files with 3 additions and 6 deletions
|
|
@ -7,7 +7,7 @@ import IMG_SPLASH from "../asset/lander/screenshot-splash.png"
|
||||||
import IMG_VSCODE from "../asset/lander/screenshot-vscode.png"
|
import IMG_VSCODE from "../asset/lander/screenshot-vscode.png"
|
||||||
import IMG_GITHUB from "../asset/lander/screenshot-github.png"
|
import IMG_GITHUB from "../asset/lander/screenshot-github.png"
|
||||||
import { IconCopy, IconCheck } from "../component/icon"
|
import { IconCopy, IconCheck } from "../component/icon"
|
||||||
import { A, createAsync, query } from "@solidjs/router"
|
import { createAsync, query, redirect } from "@solidjs/router"
|
||||||
import { getActor, withActor } from "~/context/auth"
|
import { getActor, withActor } from "~/context/auth"
|
||||||
import { Account } from "@opencode/cloud-core/account.js"
|
import { Account } from "@opencode/cloud-core/account.js"
|
||||||
|
|
||||||
|
|
@ -25,7 +25,7 @@ const isLoggedIn = query(async () => {
|
||||||
const actor = await getActor()
|
const actor = await getActor()
|
||||||
if (actor.type === "account") {
|
if (actor.type === "account") {
|
||||||
const workspaces = await withActor(() => Account.workspaces())
|
const workspaces = await withActor(() => Account.workspaces())
|
||||||
return workspaces[0].id
|
throw redirect("/" + workspaces[0].id)
|
||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
}, "isLoggedIn")
|
}, "isLoggedIn")
|
||||||
|
|
@ -82,10 +82,7 @@ export default function Home() {
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div data-slot="right">
|
<div data-slot="right">
|
||||||
{workspaceId()
|
<a href="/auth/authorize" target="_self">Login</a>
|
||||||
? <A href={`/${workspaceId()}`}>Dashboard</A>
|
|
||||||
: <a href="/auth/authorize" target="_self">Login</a>
|
|
||||||
}
|
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue