Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion frontend/src/lib/components/RemoteServerPicker.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,24 @@
const restartPicker = _.debounce(async () => {
await stopPicker();
if (!disabled) {
const forBasePath = basePath;
try {
pickerId = await StartPicker(basePath);
const newPickerId = await StartPicker(forBasePath);
// If the base path has changed since the request was made,
// or the picker has been disabled, ignore the response and release the picker
if (basePath !== forBasePath || disabled) {
await StopPicker(newPickerId);
return;
}
pickerId = newPickerId;
currentBasePath = basePath;
setupError = null;
} catch (e) {
// If the base path has changed since the request was made,
// or the picker has been disabled, ignore the response
if (basePath !== forBasePath || disabled) {
return;
}
setupError = e as string;
pendingValidCheck = false;
}
Expand Down