mirror of
https://github.com/dergigi/boris.git
synced 2025-12-17 06:34:24 +01:00
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.
This commit is contained in:
@@ -293,6 +293,9 @@ export function useArticleLoader({
|
|||||||
url: `nostr:${naddr}`
|
url: `nostr:${naddr}`
|
||||||
})
|
})
|
||||||
setReaderLoading(false) // Turn off loading immediately - we have the preview!
|
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 {
|
} else {
|
||||||
// No cache, no EventStore, no preview data - need to load from relays
|
// No cache, no EventStore, no preview data - need to load from relays
|
||||||
setReaderLoading(true)
|
setReaderLoading(true)
|
||||||
|
|||||||
Reference in New Issue
Block a user