diff options
| author | Adam <[email protected]> | 2025-12-12 06:14:22 -0600 |
|---|---|---|
| committer | Adam <[email protected]> | 2025-12-12 06:21:31 -0600 |
| commit | a160eb76df0e8f28b89440163d4e43848e007424 (patch) | |
| tree | 9ca659c43686bfe17f89b0520ae2ddde239f5df7 | |
| parent | e4b2028f9125eae8acefe7a69148d1c1ee2beb4d (diff) | |
| download | opencode-a160eb76df0e8f28b89440163d4e43848e007424.tar.gz opencode-a160eb76df0e8f28b89440163d4e43848e007424.zip | |
fix(desktop): homedir aware path on home
| -rw-r--r-- | packages/desktop/src/context/global-sync.tsx | 5 | ||||
| -rw-r--r-- | packages/desktop/src/pages/home.tsx | 5 |
2 files changed, 8 insertions, 2 deletions
diff --git a/packages/desktop/src/context/global-sync.tsx b/packages/desktop/src/context/global-sync.tsx index 2a24a845c..39e0fd34a 100644 --- a/packages/desktop/src/context/global-sync.tsx +++ b/packages/desktop/src/context/global-sync.tsx @@ -55,12 +55,14 @@ export const { use: useGlobalSync, provider: GlobalSyncProvider } = createSimple const globalSDK = useGlobalSDK() const [globalStore, setGlobalStore] = createStore<{ ready: boolean + path: Path project: Project[] provider: ProviderListResponse provider_auth: ProviderAuthResponse children: Record<string, State> }>({ ready: false, + path: { state: "", config: "", worktree: "", directory: "", home: "" }, project: [], provider: { all: [], connected: [], default: {} }, provider_auth: {}, @@ -224,6 +226,9 @@ export const { use: useGlobalSync, provider: GlobalSyncProvider } = createSimple async function bootstrap() { return Promise.all([ + globalSDK.client.path.get().then((x) => { + setGlobalStore("path", x.data!) + }), globalSDK.client.project.list().then(async (x) => { setGlobalStore( "project", diff --git a/packages/desktop/src/pages/home.tsx b/packages/desktop/src/pages/home.tsx index 205ffd815..7cd2916e8 100644 --- a/packages/desktop/src/pages/home.tsx +++ b/packages/desktop/src/pages/home.tsx @@ -1,5 +1,5 @@ import { useGlobalSync } from "@/context/global-sync" -import { For, Match, Show, Switch } from "solid-js" +import { createMemo, For, Match, Show, Switch } from "solid-js" import { Button } from "@opencode-ai/ui/button" import { Logo } from "@opencode-ai/ui/logo" import { useLayout } from "@/context/layout" @@ -14,6 +14,7 @@ export default function Home() { const layout = useLayout() const platform = usePlatform() const navigate = useNavigate() + const homedir = createMemo(() => sync.data.path.home) function openProject(directory: string) { layout.projects.open(directory) @@ -61,7 +62,7 @@ export default function Home() { class="text-14-mono text-left justify-between px-3" onClick={() => openProject(project.worktree)} > - {project.worktree} + {project.worktree.replace(homedir(), "~")} <div class="text-14-regular text-text-weak"> {DateTime.fromMillis(project.time.updated ?? project.time.created).toRelative()} </div> |
