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]]
name = "rss-reader"
version = "0.1.0"
version = "0.9.1"
dependencies = [
"actix-cors",
"actix-governor",
+7 -1
View File
@@ -1,5 +1,5 @@
<script setup>
import { onMounted, computed, nextTick, watch } from 'vue';
import { onMounted, onBeforeUnmount, computed, nextTick, watch } from 'vue';
import { useFeeds } from '@/composables/useFeeds';
const {
@@ -14,6 +14,7 @@ const {
fetchData,
sync,
getReadable,
disconnectObserver,
setInitialLoad,
showMessageForXSeconds,
} = useFeeds()
@@ -74,6 +75,11 @@ async function shareUrl(url) {
}
}
onBeforeUnmount(() => {
disconnectObserver()
setInitialLoad(false)
})
onMounted(async () => {
setInitialLoad(false)
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) {
initialLoad = value
}
@@ -375,6 +382,7 @@ export function useFeeds() {
markAllRead,
showMessageForXSeconds,
setupIntersectionObserver,
disconnectObserver,
setInitialLoad,
handleIntersection,
}