From d33d2abf8a05b2be58db5acad6960301b366aab1 Mon Sep 17 00:00:00 2001 From: padreug Date: Fri, 5 Sep 2025 01:51:11 +0200 Subject: [PATCH] Refactor NostrFeed.vue for improved connection handling - Simplify connection checks by directly accessing the isConnected property of relayHub, enhancing code clarity. - Update the loadNotes and startRealtimeSubscription functions to reflect the new connection logic, improving maintainability. --- src/modules/nostr-feed/components/NostrFeed.vue | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/modules/nostr-feed/components/NostrFeed.vue b/src/modules/nostr-feed/components/NostrFeed.vue index 16a248e..9166821 100644 --- a/src/modules/nostr-feed/components/NostrFeed.vue +++ b/src/modules/nostr-feed/components/NostrFeed.vue @@ -72,11 +72,11 @@ async function loadNotes() { error.value = null // Connect to relay hub if not already connected - if (!relayHub.isConnected.value) { + if (!relayHub.isConnected) { await relayHub.connect() } - isConnected.value = relayHub.isConnected.value + isConnected.value = relayHub.isConnected if (!isConnected.value) { throw new Error('Failed to connect to Nostr relays') @@ -138,7 +138,7 @@ async function refreshFeed() { let unsubscribe: (() => void) | null = null async function startRealtimeSubscription() { - if (!relayHub.isConnected.value) return + if (!relayHub.isConnected) return try { const filters: any[] = [{