From 83566da4ac43c6e0a8c3e63065e5a12966e4e659 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 12 Jan 2026 20:33:20 +0000 Subject: [PATCH] fix: make transaction list open by default and fix loading - Change showTransactions initial state to true (open by default) - Add proper wallet connection checks to useEffect - Ensure transactions load when wallet is connected and supports list_transactions - Add all necessary dependencies to useEffect for reliable loading - Transactions now load automatically when wallet viewer opens --- src/components/WalletViewer.tsx | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/src/components/WalletViewer.tsx b/src/components/WalletViewer.tsx index 8088778..e48d5a2 100644 --- a/src/components/WalletViewer.tsx +++ b/src/components/WalletViewer.tsx @@ -28,7 +28,7 @@ export default function WalletViewer() { const [copiedPubkey, setCopiedPubkey] = useState(false); const [transactions, setTransactions] = useState([]); const [isLoadingTx, setIsLoadingTx] = useState(false); - const [showTransactions, setShowTransactions] = useState(false); + const [showTransactions, setShowTransactions] = useState(true); async function handleRefresh() { setIsRefreshing(true); @@ -80,11 +80,25 @@ export default function WalletViewer() { } }, [supportsTransactions]); + // Load transactions when wallet is connected and section is expanded useEffect(() => { - if (showTransactions && transactions.length === 0) { + if ( + walletState.connected && + supportsTransactions && + showTransactions && + transactions.length === 0 && + !isLoadingTx + ) { loadTransactions(); } - }, [showTransactions, transactions.length, loadTransactions]); + }, [ + walletState.connected, + supportsTransactions, + showTransactions, + transactions.length, + isLoadingTx, + loadTransactions, + ]); if (!walletState.connected || !walletState.info) { return (