mirror of
https://github.com/openclaw/openclaw.git
synced 2026-03-27 09:21:35 +07:00
fix(ui): return null when default account ID is stale instead of falling back to first account
This commit is contained in:
@@ -29,10 +29,9 @@ export function resolveChannelConfigured(key: ChannelKey, props: ChannelsProps):
|
||||
|
||||
const accounts = snapshot?.channelAccounts?.[key] ?? [];
|
||||
const defaultAccountId = snapshot?.channelDefaultAccountId?.[key];
|
||||
const defaultAccount =
|
||||
(defaultAccountId
|
||||
? accounts.find((account) => account.accountId === defaultAccountId)
|
||||
: undefined) ?? accounts[0];
|
||||
const defaultAccount = defaultAccountId
|
||||
? accounts.find((account) => account.accountId === defaultAccountId)
|
||||
: accounts[0];
|
||||
|
||||
if (typeof defaultAccount?.configured === "boolean") {
|
||||
return defaultAccount.configured;
|
||||
|
||||
Reference in New Issue
Block a user