mirror of
https://github.com/dergigi/boris.git
synced 2025-12-18 15:14:20 +01:00
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:
@@ -145,6 +145,10 @@ export function useArticleLoader({
|
|||||||
setCurrentArticleEventId(storedEvent.id)
|
setCurrentArticleEventId(storedEvent.id)
|
||||||
setCurrentArticle?.(storedEvent)
|
setCurrentArticle?.(storedEvent)
|
||||||
setReaderLoading(false)
|
setReaderLoading(false)
|
||||||
|
|
||||||
|
// If we found the content in EventStore, we can return early
|
||||||
|
// This prevents unnecessary relay queries when offline
|
||||||
|
return
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
// Ignore store errors, fall through to relay query
|
// Ignore store errors, fall through to relay query
|
||||||
|
|||||||
Reference in New Issue
Block a user