mirror of
https://github.com/farion1231/cc-switch.git
synced 2026-05-06 22:01:44 +08:00
style(providers): apply prettier to common-config hooks
Reformat three hooks brought in from upstream #2191 so that format:check passes in CI.
This commit is contained in:
@@ -163,7 +163,8 @@ export function useCodexCommonConfig({
|
||||
|
||||
// 优先级:显式设置的 initialEnabled > 从配置推断的值
|
||||
// 如果 initialEnabled 为 undefined,使用推断值
|
||||
const hasCommon = initialEnabled !== undefined ? initialEnabled : inferredHasCommon;
|
||||
const hasCommon =
|
||||
initialEnabled !== undefined ? initialEnabled : inferredHasCommon;
|
||||
|
||||
// 如果应该启用通用配置但配置中还没有,则自动添加
|
||||
if (hasCommon && !inferredHasCommon && parsedSnippet.hasContent) {
|
||||
|
||||
@@ -129,7 +129,8 @@ export function useCommonConfigSnippet({
|
||||
|
||||
// 优先级:显式设置的 initialEnabled > 从配置推断的值
|
||||
// 如果 initialEnabled 为 undefined,使用推断值
|
||||
const hasCommon = initialEnabled !== undefined ? initialEnabled : inferredHasCommon;
|
||||
const hasCommon =
|
||||
initialEnabled !== undefined ? initialEnabled : inferredHasCommon;
|
||||
setUseCommonConfig(hasCommon);
|
||||
|
||||
// 如果应该启用通用配置但配置中还没有,则自动添加
|
||||
|
||||
@@ -247,10 +247,15 @@ export function useGeminiCommonConfig({
|
||||
|
||||
// 优先级:显式设置的 initialEnabled > 从配置推断的值
|
||||
// 如果 initialEnabled 为 undefined,使用推断值
|
||||
const hasCommon = initialEnabled !== undefined ? initialEnabled : inferredHasCommon;
|
||||
const hasCommon =
|
||||
initialEnabled !== undefined ? initialEnabled : inferredHasCommon;
|
||||
|
||||
// 如果应该启用通用配置但配置中还没有,则自动添加
|
||||
if (hasCommon && !inferredHasCommon && Object.keys(parsed.env).length > 0) {
|
||||
if (
|
||||
hasCommon &&
|
||||
!inferredHasCommon &&
|
||||
Object.keys(parsed.env).length > 0
|
||||
) {
|
||||
const currentEnv = envStringToObj(envValue);
|
||||
const merged = applySnippetToEnv(currentEnv, parsed.env);
|
||||
const nextEnvString = envObjToString(merged);
|
||||
|
||||
Reference in New Issue
Block a user