Skip to content

Commit b5dbf88

Browse files
hqhq1025Sun-sunshine06
authored andcommitted
fix(settings): invalidate in-flight discovery on baseUrl clear
Bump discoverySeq when scheduleDiscovery returns early due to an invalid baseUrl. Otherwise a slow probe started before the user cleared the field can still resolve and overwrite the freshly-reset `idle` state back to `found`/`failed`. Signed-off-by: hqhq1025 <1506751656@qq.com>
1 parent d397564 commit b5dbf88

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

apps/desktop/src/renderer/src/components/AddCustomProviderModal.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ export function AddCustomProviderModal({
113113
function scheduleDiscovery(currentBaseUrl: string, currentWire: WireApi) {
114114
if (debounceTimer.current !== null) clearTimeout(debounceTimer.current);
115115
if (!currentBaseUrl.trim().match(/^https?:\/\//)) {
116+
discoverySeq.current += 1;
116117
setDiscovery({ kind: 'idle' });
117118
return;
118119
}

0 commit comments

Comments
 (0)