mirror of
https://github.com/farion1231/cc-switch.git
synced 2026-07-24 12:44:18 +08:00
chore: satisfy clippy::nonminimal_bool and prettier to unblock CI
- codex_config: rewrite `!(A && !B)` as `!A || B` (De Morgan- equivalent) — also reads more directly as "no OAuth, or already has provider API key". - UsageScriptModal: reflow conditional onto one line per prettier.
This commit is contained in:
@@ -505,7 +505,7 @@ pub fn should_restore_codex_provider_token_for_backfill(
|
||||
|
||||
let has_provider_api_key = extract_codex_auth_api_key(auth).is_some();
|
||||
let has_oauth_login = codex_auth_has_oauth_login_material(auth);
|
||||
!(has_oauth_login && !has_provider_api_key)
|
||||
!has_oauth_login || has_provider_api_key
|
||||
}
|
||||
|
||||
fn parse_codex_positive_u64(value: Option<&Value>) -> Option<u64> {
|
||||
|
||||
@@ -177,8 +177,7 @@ const UsageScriptModal: React.FC<UsageScriptModalProps> = ({
|
||||
const auth = (config as any).auth || {};
|
||||
const configToml = (config as any).config || "";
|
||||
const apiKey =
|
||||
typeof auth.OPENAI_API_KEY === "string" &&
|
||||
auth.OPENAI_API_KEY.trim()
|
||||
typeof auth.OPENAI_API_KEY === "string" && auth.OPENAI_API_KEY.trim()
|
||||
? auth.OPENAI_API_KEY
|
||||
: extractCodexExperimentalBearerToken(configToml);
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user