mirror of
https://github.com/dergigi/boris.git
synced 2025-12-18 07:04:19 +01:00
fix: resolve highlight loading issues for articles
- Add missing eventStore parameter to fetchHighlightsForArticle call - Clear highlights immediately when starting to load new article - Fix infinite loading spinners when articles have zero highlights - Ensure highlights are properly stored and persisted
This commit is contained in:
@@ -76,6 +76,10 @@ export function useArticleLoader({
|
|||||||
setSelectedUrl(`nostr:${naddr}`)
|
setSelectedUrl(`nostr:${naddr}`)
|
||||||
setIsCollapsed(true)
|
setIsCollapsed(true)
|
||||||
|
|
||||||
|
// Clear highlights immediately when starting to load a new article
|
||||||
|
setHighlights([])
|
||||||
|
setHighlightsLoading(false) // Don't show loading yet
|
||||||
|
|
||||||
// If we have preview data from navigation, show it immediately (no skeleton!)
|
// If we have preview data from navigation, show it immediately (no skeleton!)
|
||||||
if (previewData) {
|
if (previewData) {
|
||||||
setReaderContent({
|
setReaderContent({
|
||||||
@@ -251,7 +255,9 @@ export function useArticleLoader({
|
|||||||
return next.sort((a, b) => b.created_at - a.created_at)
|
return next.sort((a, b) => b.created_at - a.created_at)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
settingsRef.current
|
settingsRef.current,
|
||||||
|
false, // force
|
||||||
|
eventStore || undefined
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
// No article event to fetch highlights for - clear and don't show loading
|
// No article event to fetch highlights for - clear and don't show loading
|
||||||
|
|||||||
Reference in New Issue
Block a user