fix: deduplicate in select provider models and target models

This commit is contained in:
jialin
2026-02-08 17:20:05 +08:00
parent ec6f5d1ad3
commit 379eeedde2
6 changed files with 80 additions and 43 deletions
@@ -31,9 +31,10 @@ const SupportedModels = () => {
const handleOpenChange = async (open: boolean) => {
try {
await form.validateFields(['api_key']);
await form.validateFields(['api_key', ['config', 'type']]);
const currentAPIKey = form.getFieldValue('api_key') || '';
console.log('handleOpenChange', { open, currentAPIKey });
// Avoid repeated requests with the same API key
if (
@@ -54,7 +55,9 @@ const SupportedModels = () => {
}
});
}
} catch (error) {}
} catch (error) {
prevAPIKeyRef.current = '';
}
};
const updateModelList = (models: ProviderModel[]) => {