From 9d75a646eee14a999965efb6007a23ff4e2ed7a2 Mon Sep 17 00:00:00 2001 From: Jason Date: Thu, 16 Oct 2025 22:21:46 +0800 Subject: [PATCH] fix: allow API Key editing in edit mode Fixed logic in useApiKeyState.ts to correctly show API Key input when editing existing providers. Changed condition from `!isEditMode && hasApiKeyField(config)` to `isEditMode && hasApiKeyField(config)` to match the original form's behavior. This restores the ability to directly update API keys when editing existing providers that have API key fields in their configuration. --- src/components/providers/forms/hooks/useApiKeyState.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/providers/forms/hooks/useApiKeyState.ts b/src/components/providers/forms/hooks/useApiKeyState.ts index 2c9503c..f0670f2 100644 --- a/src/components/providers/forms/hooks/useApiKeyState.ts +++ b/src/components/providers/forms/hooks/useApiKeyState.ts @@ -48,7 +48,7 @@ export function useApiKeyState({ const showApiKey = useCallback( (config: string, isEditMode: boolean) => { return ( - selectedPresetId !== null || (!isEditMode && hasApiKeyField(config)) + selectedPresetId !== null || (isEditMode && hasApiKeyField(config)) ); }, [selectedPresetId],