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
This commit is contained in:
Gigi
2025-10-30 20:18:06 +01:00
parent 2f5fe87fc8
commit ad56acb712

View File

@@ -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