diff --git a/vue/src/composables/useFeeds.js b/vue/src/composables/useFeeds.js index 2801020..6fbc3b4 100644 --- a/vue/src/composables/useFeeds.js +++ b/vue/src/composables/useFeeds.js @@ -267,6 +267,13 @@ function toggleViewMode() { if (viewMode.value === 'article') { leaveArticleView() } else { + // Disconnect first: the v-if switch is about to unmount all .observe + // elements, which would otherwise fire intersection callbacks reporting + // them as no-longer-intersecting and mark every visible article read. + if (observer) { + observer.disconnect() + observer = null + } viewMode.value = 'article' currentIndex.value = 0 markCurrentArticleRead()