desktop: track currentSidecarUrl
This commit is contained in:
@@ -35,6 +35,7 @@ export const { use: useServer, provider: ServerProvider } = createSimpleContext(
|
|||||||
Persist.global("server", ["server.v3"]),
|
Persist.global("server", ["server.v3"]),
|
||||||
createStore({
|
createStore({
|
||||||
list: [] as string[],
|
list: [] as string[],
|
||||||
|
currentSidecarUrl: "",
|
||||||
projects: {} as Record<string, StoredProject[]>,
|
projects: {} as Record<string, StoredProject[]>,
|
||||||
lastProject: {} as Record<string, string>,
|
lastProject: {} as Record<string, string>,
|
||||||
}),
|
}),
|
||||||
@@ -96,6 +97,11 @@ export const { use: useServer, provider: ServerProvider } = createSimpleContext(
|
|||||||
const url = normalizeServerUrl(props.defaultUrl)
|
const url = normalizeServerUrl(props.defaultUrl)
|
||||||
if (!url) return
|
if (!url) return
|
||||||
batch(() => {
|
batch(() => {
|
||||||
|
// Remove the previous startup sidecar url
|
||||||
|
if(store.currentSidecarUrl) {
|
||||||
|
remove(store.currentSidecarUrl)
|
||||||
|
}
|
||||||
|
|
||||||
// Add the new sidecar url
|
// Add the new sidecar url
|
||||||
if (props.isSidecar && props.defaultUrl) {
|
if (props.isSidecar && props.defaultUrl) {
|
||||||
add(props.defaultUrl)
|
add(props.defaultUrl)
|
||||||
|
|||||||
Reference in New Issue
Block a user