mirror of
https://github.com/sst/opencode.git
synced 2025-12-23 10:11:41 +00:00
This commit is contained in:
parent
85974e9acd
commit
81ee2d2332
1 changed files with 3 additions and 1 deletions
|
|
@ -22,9 +22,10 @@ export default function Layout(props: ParentProps) {
|
|||
const layout = useLayout()
|
||||
const currentDirectory = createMemo(() => base64Decode(params.dir ?? ""))
|
||||
const sessions = createMemo(() => globalSync.child(currentDirectory())[0].session ?? [])
|
||||
const currentSession = createMemo(() => sessions().find((s) => s.id === params.id) ?? sessions().at(0))
|
||||
const currentSession = createMemo(() => sessions().find((s) => s.id === params.id))
|
||||
|
||||
function navigateToSession(session: Session | undefined) {
|
||||
if (!session) return
|
||||
navigate(`/${params.dir}/session/${session?.id}`)
|
||||
}
|
||||
|
||||
|
|
@ -59,6 +60,7 @@ export default function Layout(props: ParentProps) {
|
|||
<Select
|
||||
options={sessions()}
|
||||
current={currentSession()}
|
||||
placeholder="Select session"
|
||||
label={(x) => x.title}
|
||||
value={(x) => x.id}
|
||||
onSelect={navigateToSession}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue