diff --git a/vue/src/composables/useFeeds.js b/vue/src/composables/useFeeds.js index d9734c1..f662d07 100644 --- a/vue/src/composables/useFeeds.js +++ b/vue/src/composables/useFeeds.js @@ -199,13 +199,18 @@ function markCurrentArticleRead() { } } -function leaveArticleView() { +async function leaveArticleView() { // Articles paged past in article view were marked read but deliberately kept // in place so currentIndex stayed valid — drop them now so they don't keep // showing up in the list view. feeds.value = feeds.value.filter(feed => !feed.read) currentIndex.value = 0 viewMode.value = 'list' + // The v-if on the list container tears down and recreates all .observe DOM + // nodes when switching views, so the intersection observer must be + // re-pointed at the new elements after Vue has finished rendering. + await nextTick() + setupIntersectionObserver() } function toggleViewMode() {