|
|
@@ -1,6 +1,7 @@
|
|
|
import { Show, createMemo } from "solid-js"
|
|
|
import { DateTime } from "luxon"
|
|
|
import { useSync } from "@/context/sync"
|
|
|
+import { useSDK } from "@/context/sdk"
|
|
|
import { useLanguage } from "@/context/language"
|
|
|
import { Icon } from "@opencode-ai/ui/icon"
|
|
|
import { getDirectory, getFilename } from "@opencode-ai/util/path"
|
|
|
@@ -15,6 +16,7 @@ interface NewSessionViewProps {
|
|
|
|
|
|
export function NewSessionView(props: NewSessionViewProps) {
|
|
|
const sync = useSync()
|
|
|
+ const sdk = useSDK()
|
|
|
const language = useLanguage()
|
|
|
|
|
|
const sandboxes = createMemo(() => sync.project?.sandboxes ?? [])
|
|
|
@@ -24,11 +26,11 @@ export function NewSessionView(props: NewSessionViewProps) {
|
|
|
if (options().includes(selection)) return selection
|
|
|
return MAIN_WORKTREE
|
|
|
})
|
|
|
- const projectRoot = createMemo(() => sync.project?.worktree ?? sync.data.path.directory)
|
|
|
+ const projectRoot = createMemo(() => sync.project?.worktree ?? sdk.directory)
|
|
|
const isWorktree = createMemo(() => {
|
|
|
const project = sync.project
|
|
|
if (!project) return false
|
|
|
- return sync.data.path.directory !== project.worktree
|
|
|
+ return sdk.directory !== project.worktree
|
|
|
})
|
|
|
|
|
|
const label = (value: string) => {
|