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.
This commit is contained in:
Jason
2025-10-16 22:21:46 +08:00
parent 0868a71576
commit 9d75a646ee

View File

@@ -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],