fix(app): remount SDK/sync tree when server URL changes (#13437)
This commit is contained in:
parent
9f20e0d14b
commit
ebe5a2b74a
1 changed files with 6 additions and 3 deletions
|
|
@ -1,5 +1,5 @@
|
||||||
import "@/index.css"
|
import "@/index.css"
|
||||||
import { ErrorBoundary, Suspense, lazy, type JSX, type ParentProps } from "solid-js"
|
import { ErrorBoundary, Show, Suspense, lazy, type JSX, type ParentProps } from "solid-js"
|
||||||
import { Router, Route, Navigate } from "@solidjs/router"
|
import { Router, Route, Navigate } from "@solidjs/router"
|
||||||
import { MetaProvider } from "@solidjs/meta"
|
import { MetaProvider } from "@solidjs/meta"
|
||||||
import { Font } from "@opencode-ai/ui/font"
|
import { Font } from "@opencode-ai/ui/font"
|
||||||
|
|
@ -156,8 +156,11 @@ export function AppBaseProviders(props: ParentProps) {
|
||||||
|
|
||||||
function ServerKey(props: ParentProps) {
|
function ServerKey(props: ParentProps) {
|
||||||
const server = useServer()
|
const server = useServer()
|
||||||
if (!server.url) return null
|
return (
|
||||||
return props.children
|
<Show when={server.url} keyed>
|
||||||
|
{props.children}
|
||||||
|
</Show>
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
export function AppInterface(props: { defaultUrl?: string; children?: JSX.Element; isSidecar?: boolean }) {
|
export function AppInterface(props: { defaultUrl?: string; children?: JSX.Element; isSidecar?: boolean }) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue