fix article read after switching to article view
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user