fix(settings): fix Zai API key clear/save and update GitManagerModal tests
- hasApiKey now only returns true for stored api_key credentials; previously it fell back to hasAuth() which includes env vars, causing Clear to appear to do nothing and Save to never appear - Save button now shows when user types into the key input even if already authenticated, allowing key updates without clearing first - Remove unused importFile state variable (TS 6133 lint error) - Update GitManagerModal tests to pass undefined as projectId argument to all API mocks, matching the component's project-aware API signatures Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -87,7 +87,7 @@ export function wrapAuthStorageWithApiKeyProviders(
|
||||
},
|
||||
hasApiKey: (providerId) => {
|
||||
const credential = authStorage.get(providerId);
|
||||
return credential?.type === "api_key" || authStorage.hasAuth(providerId);
|
||||
return credential?.type === "api_key" && !!credential.key;
|
||||
},
|
||||
getApiKey: (providerId) => authStorage.getApiKey(providerId),
|
||||
get: (providerId) => authStorage.get(providerId),
|
||||
|
||||
Reference in New Issue
Block a user