mirror of
https://github.com/farion1231/cc-switch.git
synced 2026-07-24 12:44:18 +08:00
fix(providers): disable test/usage buttons for Copilot and Codex OAuth cards
These OAuth providers ship with non-empty ANTHROPIC_BASE_URL, so the isOfficialProvider() heuristic (which checks for a missing base URL) returned false and left the health-check and usage-config buttons enabled — inconsistent with other official OAuth cards. Extend the button disabling logic at the call site with isCopilot / isCodexOauth, matching the pattern already used for the quota footer branch above.
This commit is contained in:
@@ -417,10 +417,14 @@ export function ProviderCard({
|
||||
onEdit={() => onEdit(provider)}
|
||||
onDuplicate={() => onDuplicate(provider)}
|
||||
onTest={
|
||||
onTest && !isOfficial ? () => onTest(provider) : undefined
|
||||
onTest && !isOfficial && !isCopilot && !isCodexOauth
|
||||
? () => onTest(provider)
|
||||
: undefined
|
||||
}
|
||||
onConfigureUsage={
|
||||
isOfficial ? undefined : () => onConfigureUsage(provider)
|
||||
isOfficial || isCopilot || isCodexOauth
|
||||
? undefined
|
||||
: () => onConfigureUsage(provider)
|
||||
}
|
||||
onDelete={() => onDelete(provider)}
|
||||
onRemoveFromConfig={
|
||||
|
||||
Reference in New Issue
Block a user