desktop: track currentSidecarUrl
This commit is contained in:
parent
d4a68b0f4e
commit
520110e864
1 changed files with 6 additions and 0 deletions
|
|
@ -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)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue