From ca1539f5349d640f53643c7b651687916a3d74ad Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 29 Jan 2026 16:40:55 +0000 Subject: [PATCH] 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 --- src/components/nostr/user-menu.tsx | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/components/nostr/user-menu.tsx b/src/components/nostr/user-menu.tsx index d2d0541..c40ee55 100644 --- a/src/components/nostr/user-menu.tsx +++ b/src/components/nostr/user-menu.tsx @@ -228,8 +228,7 @@ export default function UserMenu() {
{/* Balance */} - {(balance !== undefined || - nwcConnection.balance !== undefined) && ( + {balance !== undefined && (
Balance: @@ -243,7 +242,7 @@ export default function UserMenu() { {state.walletBalancesBlurred ? "✦✦✦✦✦✦" - : formatBalance(balance ?? nwcConnection.balance)} + : formatBalance(balance)} {state.walletBalancesBlurred ? ( @@ -402,14 +401,13 @@ export default function UserMenu() { >
- {balance !== undefined || - nwcConnection.balance !== undefined ? ( + {balance !== undefined && ( {state.walletBalancesBlurred ? "✦✦✦✦" - : formatBalance(balance ?? nwcConnection.balance)} + : formatBalance(balance)} - ) : null} + )}