Fix article get read when navigation to admin area.

This commit is contained in:
2026-06-19 16:41:16 +02:00
parent dfc2e29e36
commit 7a24980101
3 changed files with 16 additions and 2 deletions
Generated
+1 -1
View File
@@ -2550,7 +2550,7 @@ dependencies = [
[[package]] [[package]]
name = "rss-reader" name = "rss-reader"
version = "0.1.0" version = "0.9.1"
dependencies = [ dependencies = [
"actix-cors", "actix-cors",
"actix-governor", "actix-governor",
+7 -1
View File
@@ -1,5 +1,5 @@
<script setup> <script setup>
import { onMounted, computed, nextTick, watch } from 'vue'; import { onMounted, onBeforeUnmount, computed, nextTick, watch } from 'vue';
import { useFeeds } from '@/composables/useFeeds'; import { useFeeds } from '@/composables/useFeeds';
const { const {
@@ -14,6 +14,7 @@ const {
fetchData, fetchData,
sync, sync,
getReadable, getReadable,
disconnectObserver,
setInitialLoad, setInitialLoad,
showMessageForXSeconds, showMessageForXSeconds,
} = useFeeds() } = useFeeds()
@@ -74,6 +75,11 @@ async function shareUrl(url) {
} }
} }
onBeforeUnmount(() => {
disconnectObserver()
setInitialLoad(false)
})
onMounted(async () => { onMounted(async () => {
setInitialLoad(false) setInitialLoad(false)
await fetchData() await fetchData()
+8
View File
@@ -268,6 +268,13 @@ function handleIntersection(entries, topbarHeight = 0) {
}) })
} }
function disconnectObserver() {
if (observer) {
observer.disconnect()
observer = null
}
}
function setInitialLoad(value) { function setInitialLoad(value) {
initialLoad = value initialLoad = value
} }
@@ -375,6 +382,7 @@ export function useFeeds() {
markAllRead, markAllRead,
showMessageForXSeconds, showMessageForXSeconds,
setupIntersectionObserver, setupIntersectionObserver,
disconnectObserver,
setInitialLoad, setInitialLoad,
handleIntersection, handleIntersection,
} }