run preflight (#55)

This commit is contained in:
Fan 2025-07-23 16:18:31 +08:00 committed by GitHub
parent 173246723e
commit 40ee936453
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 62 additions and 40 deletions

View file

@ -47,24 +47,27 @@ export function AuthDialog({
const [showOpenAIKeyPrompt, setShowOpenAIKeyPrompt] = useState(false);
const items = [{ label: 'OpenAI', value: AuthType.USE_OPENAI }];
const initialAuthIndex = Math.max(0, items.findIndex((item) => {
if (settings.merged.selectedAuthType) {
return item.value === settings.merged.selectedAuthType;
}
const initialAuthIndex = Math.max(
0,
items.findIndex((item) => {
if (settings.merged.selectedAuthType) {
return item.value === settings.merged.selectedAuthType;
}
const defaultAuthType = parseDefaultAuthType(
process.env.GEMINI_DEFAULT_AUTH_TYPE,
);
if (defaultAuthType) {
return item.value === defaultAuthType;
}
const defaultAuthType = parseDefaultAuthType(
process.env.GEMINI_DEFAULT_AUTH_TYPE,
);
if (defaultAuthType) {
return item.value === defaultAuthType;
}
if (process.env.GEMINI_API_KEY) {
return item.value === AuthType.USE_GEMINI;
}
if (process.env.GEMINI_API_KEY) {
return item.value === AuthType.USE_GEMINI;
}
return item.value === AuthType.LOGIN_WITH_GOOGLE;
}));
return item.value === AuthType.LOGIN_WITH_GOOGLE;
}),
);
const handleAuthSelect = (authMethod: AuthType) => {
const error = validateAuthMethod(authMethod);