From 15d155c565293d1793e61bbfd2011b99db351f7a Mon Sep 17 00:00:00 2001 From: Gigi Date: Thu, 2 Oct 2025 09:17:05 +0200 Subject: [PATCH] fix: resolve undefined timeoutId variable in fetchBookmarks function - Move timeoutId declaration outside try block to make it accessible in both try and catch blocks - Fixes ESLint no-undef error and TypeScript compilation error --- src/components/Bookmarks.tsx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/components/Bookmarks.tsx b/src/components/Bookmarks.tsx index 836a056a..b6a4afc8 100644 --- a/src/components/Bookmarks.tsx +++ b/src/components/Bookmarks.tsx @@ -80,16 +80,16 @@ const Bookmarks: React.FC = ({ relayPool, onLogout }) => { return } + // Set a timeout to ensure loading state gets reset + const timeoutId = setTimeout(() => { + console.log('⏰ Timeout reached, resetting loading state') + setLoading(false) + }, 15000) // 15 second timeout + try { setLoading(true) console.log('🚀 NEW VERSION: Fetching bookmark list for pubkey:', activeAccount.pubkey) - // Set a timeout to ensure loading state gets reset - const timeoutId = setTimeout(() => { - console.log('⏰ Timeout reached, resetting loading state') - setLoading(false) - }, 15000) // 15 second timeout - // Get relay URLs from the pool const relayUrls = Array.from(relayPool.relays.values()).map(relay => relay.url)