mirror of
https://github.com/tiennm99/ccs.git
synced 2026-10-14 06:17:27 +00:00
fix(cliproxy): prevent blank page in remote mode
This commit is contained in:
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 } }>({
|
||||
|
||||
Reference in new issue
Block a user