From ad56acb7125bcfdebbc4b68540f81f412fbda7c2 Mon Sep 17 00:00:00 2001 From: Gigi Date: Thu, 30 Oct 2025 20:18:06 +0100 Subject: [PATCH] fix: prevent unnecessary relay queries when article content is cached - Return early from useArticleLoader when content is found in EventStore - This prevents loading skeleton from showing when going offline with cached content - Improves offline experience by using locally cached article content --- src/hooks/useArticleLoader.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/hooks/useArticleLoader.ts b/src/hooks/useArticleLoader.ts index 252e9df2..d2fc8ba7 100644 --- a/src/hooks/useArticleLoader.ts +++ b/src/hooks/useArticleLoader.ts @@ -145,6 +145,10 @@ export function useArticleLoader({ setCurrentArticleEventId(storedEvent.id) setCurrentArticle?.(storedEvent) setReaderLoading(false) + + // If we found the content in EventStore, we can return early + // This prevents unnecessary relay queries when offline + return } } catch (err) { // Ignore store errors, fall through to relay query