Skip to content

Commit 3c375b9

Browse files
committed
desktop: use Show instead of Suspense
1 parent 6590c16 commit 3c375b9

2 files changed

Lines changed: 8 additions & 5 deletions

File tree

packages/desktop/src-tauri/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ fn spawn_sidecar(app: &AppHandle, port: u32) -> CommandChild {
139139
.args([
140140
"-il",
141141
"-c",
142-
&format!("{} serve --port={}", sidecar.display(), port),
142+
&format!("\"{}\" serve --port={}", sidecar.display(), port),
143143
])
144144
.spawn()
145145
.expect("Failed to spawn opencode")

packages/desktop/src/index.tsx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import { Suspense, createResource, ParentProps } from "solid-js"
1818
import { UPDATER_ENABLED } from "./updater"
1919
import { createMenu } from "./menu"
2020
import pkg from "../package.json"
21+
import { Show } from "solid-js";
2122

2223
const root = document.getElementById("root")
2324
if (import.meta.env.DEV && !(root instanceof HTMLElement)) {
@@ -288,17 +289,19 @@ function ServerGate(props: ParentProps) {
288289
})
289290

290291
return (
291-
<Suspense
292+
// Not using suspense as not all components are compatible with it (undefined refs)
293+
<Show
294+
when={status.state !== "pending"}
292295
fallback={
293296
<div class="h-screen w-screen flex flex-col items-center justify-center bg-background-base">
294297
<Logo class="w-xl opacity-12 animate-pulse" />
295298
<div class="mt-8 text-14-regular text-text-weak">Starting server...</div>
296299
</div>
297300
}
298301
>
299-
{/* Triggers suspense/error boundaries without rendering the returned value */}
302+
{/* Trigger error boundary without rendering the returned value */}
300303
{(status(), null)}
301-
<Suspense>{props.children}</Suspense>
302-
</Suspense>
304+
{props.children}
305+
</Show>
303306
)
304307
}

0 commit comments

Comments
 (0)