mirror of
https://github.com/DayuanJiang/next-ai-draw-io.git
synced 2026-01-02 22:32:27 +08:00
fix: reset validation button to Test after success
This commit is contained in:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user