Skip to content

Commit 520110e

Browse files
committed
desktop: track currentSidecarUrl
1 parent d4a68b0 commit 520110e

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

packages/app/src/context/server.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ export const { use: useServer, provider: ServerProvider } = createSimpleContext(
3535
Persist.global("server", ["server.v3"]),
3636
createStore({
3737
list: [] as string[],
38+
currentSidecarUrl: "",
3839
projects: {} as Record<string, StoredProject[]>,
3940
lastProject: {} as Record<string, string>,
4041
}),
@@ -96,6 +97,11 @@ export const { use: useServer, provider: ServerProvider } = createSimpleContext(
9697
const url = normalizeServerUrl(props.defaultUrl)
9798
if (!url) return
9899
batch(() => {
100+
// Remove the previous startup sidecar url
101+
if(store.currentSidecarUrl) {
102+
remove(store.currentSidecarUrl)
103+
}
104+
99105
// Add the new sidecar url
100106
if (props.isSidecar && props.defaultUrl) {
101107
add(props.defaultUrl)

0 commit comments

Comments
 (0)