fix: remove circular dependency in loadInitialTransactions

Removed txLoadFailed from the dependency array of loadInitialTransactions
callback, which was causing a circular dependency:
- loadInitialTransactions depended on txLoadFailed
- Function sets txLoadFailed, triggering recreation
- New function reference triggers useEffect again
- Infinite loop

The txLoadAttempted flag in the useEffect is sufficient to prevent
repeated loads. No need to check txLoadFailed inside the callback.
This commit is contained in:
Claude
2026-01-18 17:23:41 +00:00
parent 145048df39
commit a398922254

View File

@@ -247,9 +247,6 @@ export default function WalletViewer() {
}, [getInfo]);
const loadInitialTransactions = useCallback(async () => {
// Prevent repeated attempts if already failed
if (txLoadFailed) return;
setLoading(true);
setTxLoadAttempted(true);
try {
@@ -269,7 +266,7 @@ export default function WalletViewer() {
} finally {
setLoading(false);
}
}, [listTransactions, txLoadFailed]);
}, [listTransactions]);
useEffect(() => {
if (isConnected) {