refactor(wallet): use single data source for balance across UI

Remove fallback to nwcConnection.balance in user-menu - now both
WalletViewer and user-menu use balance$ observable as the single
source of truth for wallet balance.

https://claude.ai/code/session_01CnJgjFMvZHZWs2ujAiWAiQ
This commit is contained in:
Claude
2026-01-29 16:40:55 +00:00
parent 56b3493d3d
commit ca1539f534

View File

@@ -228,8 +228,7 @@ export default function UserMenu() {
<div className="space-y-4">
{/* Balance */}
{(balance !== undefined ||
nwcConnection.balance !== undefined) && (
{balance !== undefined && (
<div className="flex items-center justify-between">
<span className="text-sm text-muted-foreground">
Balance:
@@ -243,7 +242,7 @@ export default function UserMenu() {
<span>
{state.walletBalancesBlurred
? "✦✦✦✦✦✦"
: formatBalance(balance ?? nwcConnection.balance)}
: formatBalance(balance)}
</span>
{state.walletBalancesBlurred ? (
<EyeOff className="size-3 text-muted-foreground" />
@@ -402,14 +401,13 @@ export default function UserMenu() {
>
<div className="flex items-center gap-2">
<Wallet className="size-4 text-muted-foreground" />
{balance !== undefined ||
nwcConnection.balance !== undefined ? (
{balance !== undefined && (
<span className="text-sm">
{state.walletBalancesBlurred
? "✦✦✦✦"
: formatBalance(balance ?? nwcConnection.balance)}
: formatBalance(balance)}
</span>
) : null}
)}
</div>
<div className="flex items-center gap-1.5">
<span