From 4d41b8664cf6ee51dc891bf23ab1913962a5e0f4 Mon Sep 17 00:00:00 2001 From: ted Date: Tue, 24 Mar 2026 19:27:56 -0700 Subject: [PATCH] fix(ui): return null when default account ID is stale instead of falling back to first account --- ui/src/ui/views/channels.shared.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/ui/src/ui/views/channels.shared.ts b/ui/src/ui/views/channels.shared.ts index 5bd5755ea1c..7838d3966a9 100644 --- a/ui/src/ui/views/channels.shared.ts +++ b/ui/src/ui/views/channels.shared.ts @@ -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;