diff options
| author | adamelmore <[email protected]> | 2026-01-24 17:17:38 -0600 |
|---|---|---|
| committer | adamelmore <[email protected]> | 2026-01-24 17:17:44 -0600 |
| commit | 8d1a66d04333edda5288007cb7fbdae40d204d86 (patch) | |
| tree | 127c7c539869f69a76bbfcb14f1c4f1602840885 | |
| parent | e1fe86e6d725d289ed9f2afeedffe321bf137b73 (diff) | |
| download | opencode-8d1a66d04333edda5288007cb7fbdae40d204d86.tar.gz opencode-8d1a66d04333edda5288007cb7fbdae40d204d86.zip | |
fix(app): unnecessary suspense flash
| -rw-r--r-- | packages/app/src/components/dialog-select-server.tsx | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/packages/app/src/components/dialog-select-server.tsx b/packages/app/src/components/dialog-select-server.tsx index 6a4ae55c3..2206e4a48 100644 --- a/packages/app/src/components/dialog-select-server.tsx +++ b/packages/app/src/components/dialog-select-server.tsx @@ -147,7 +147,14 @@ export function DialogSelectServer() { status: undefined as boolean | undefined, }, }) - const [defaultUrl, defaultUrlActions] = createResource(() => platform.getDefaultServerUrl?.()) + const [defaultUrl, defaultUrlActions] = createResource( + async () => { + const url = await platform.getDefaultServerUrl?.() + if (!url) return null + return normalizeServerUrl(url) ?? null + }, + { initialValue: null }, + ) const isDesktop = platform.platform === "desktop" const looksComplete = (value: string) => { @@ -502,7 +509,7 @@ export function DialogSelectServer() { <DropdownMenu.Item onSelect={async () => { await platform.setDefaultServerUrl?.(i) - defaultUrlActions.refetch(i) + defaultUrlActions.mutate(i) }} > <DropdownMenu.ItemLabel> @@ -514,7 +521,7 @@ export function DialogSelectServer() { <DropdownMenu.Item onSelect={async () => { await platform.setDefaultServerUrl?.(null) - defaultUrlActions.refetch(null) + defaultUrlActions.mutate(null) }} > <DropdownMenu.ItemLabel> |
