fix: reset validation button to Test after success

This commit is contained in:
dayuan.jiang
2025-12-22 20:13:57 +09:00
parent 1f6ef7ac90
commit 1be0cfa06c

View File

@@ -290,12 +290,14 @@ export function ModelConfigDialog({
setValidatingModelIndex(null) setValidatingModelIndex(null)
if (allValid) { if (allValid) {
setValidationStatus("success")
updateProvider(selectedProviderId!, { validated: true }) updateProvider(selectedProviderId!, { validated: true })
// Reset to idle after showing success briefly
setTimeout(() => setValidationStatus("idle"), 1500)
} else { } else {
setValidationStatus("error")
setValidationError(`${errorCount} model(s) failed validation`) setValidationError(`${errorCount} model(s) failed validation`)
} }
// Reset to idle so button shows "Test" again
setValidationStatus("idle")
}, [selectedProvider, selectedProviderId, updateProvider, updateModel]) }, [selectedProvider, selectedProviderId, updateProvider, updateModel])
// Get all available provider types // Get all available provider types