fix(cliproxy): prevent blank page in remote mode

This commit is contained in:
Tam Nhu Tran committed 2026-02-24 00:47:40 +07:00
1 parent a6e1455f38
commit 4eb2be79fc
4 files changed
+72 -8

No files matched your search

@@ -105,7 +105,16 @@ export function ProviderEditor({
missingRequiredFields,
} = useProviderEditor(provider);
const accounts = authStatus.accounts || [];
// Defensive normalization: remote/legacy payloads may omit account.provider.
// Fallback to current editor provider to avoid runtime crashes in account UI.
const accounts = useMemo(
() =>
(authStatus.accounts || []).map((account) => ({
...account,
provider: account.provider || baseProvider || provider,
})),
[authStatus.accounts, baseProvider, provider]
);
// Fetch effective API key for presets (uses configured value, not hardcoded)
const { data: authTokens } = useQuery<{ apiKey: { value: string } }>({