mirror of
https://github.com/dergigi/boris.git
synced 2025-12-17 06:34:24 +01:00
fix: clear reader content immediately when naddr changes
Prevent showing stale images from previous articles by clearing readerContent at the start of the effect when navigating to a new article.
This commit is contained in:
@@ -76,11 +76,16 @@ export function useArticleLoader({
|
|||||||
// First check: naddr is required
|
// First check: naddr is required
|
||||||
if (!naddr) {
|
if (!naddr) {
|
||||||
console.log('[article-loader] Skipping load - missing naddr')
|
console.log('[article-loader] Skipping load - missing naddr')
|
||||||
|
setReaderContent(undefined)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log('[article-loader] Starting load for naddr:', naddr)
|
console.log('[article-loader] Starting load for naddr:', naddr)
|
||||||
|
|
||||||
|
// Clear readerContent immediately to prevent showing stale content from previous article
|
||||||
|
// This ensures images from previous articles don't flash briefly
|
||||||
|
setReaderContent(undefined)
|
||||||
|
|
||||||
// Synchronously check cache sources BEFORE checking relayPool
|
// Synchronously check cache sources BEFORE checking relayPool
|
||||||
// This prevents showing loading skeletons when content is immediately available
|
// This prevents showing loading skeletons when content is immediately available
|
||||||
// and fixes the race condition where relayPool isn't ready yet
|
// and fixes the race condition where relayPool isn't ready yet
|
||||||
|
|||||||
Reference in New Issue
Block a user