From cea2d0eda294d99cf663ef374929ed170b53233a Mon Sep 17 00:00:00 2001 From: Gigi Date: Fri, 31 Oct 2025 01:39:11 +0100 Subject: [PATCH] perf: avoid redundant image preload when using preview data Skip image preload in useArticleLoader when preview data is available, since the image should already be cached from BlogPostCard. This prevents unnecessary network requests when navigating from explore. --- src/hooks/useArticleLoader.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/hooks/useArticleLoader.ts b/src/hooks/useArticleLoader.ts index 8450f0a5..49a8abe2 100644 --- a/src/hooks/useArticleLoader.ts +++ b/src/hooks/useArticleLoader.ts @@ -293,6 +293,9 @@ export function useArticleLoader({ url: `nostr:${naddr}` }) setReaderLoading(false) // Turn off loading immediately - we have the preview! + + // Don't preload image here - it should already be cached from BlogPostCard + // Preloading again would be redundant and could cause unnecessary network requests } else { // No cache, no EventStore, no preview data - need to load from relays setReaderLoading(true)