refactor: prevent apiKey field creation for official providers
Improved useApiKeyState hook to explicitly handle category parameter: - Only create apiKey field for non-official providers in add mode - Explicitly check category !== undefined to avoid unintended behavior - Added comprehensive comments explaining the logic - Updated dependency array to include category parameter This ensures official provider configs remain clean without empty apiKey fields.
This commit is contained in:
@@ -121,6 +121,7 @@ export function ProviderForm({
|
||||
initialConfig: form.watch("settingsConfig"),
|
||||
onConfigChange: (config) => form.setValue("settingsConfig", config),
|
||||
selectedPresetId,
|
||||
category,
|
||||
});
|
||||
|
||||
// 使用 Base URL hook (仅 Claude 模式)
|
||||
|
||||
Reference in New Issue
Block a user