backend, mark item as read
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
<script setup>
|
||||
import { ref, onMounted, nextTick } from 'vue';
|
||||
import { ref, unref, onMounted, nextTick } from 'vue';
|
||||
import axios from 'axios';
|
||||
import { Readability } from '@mozilla/readability';
|
||||
|
||||
@@ -124,12 +124,19 @@ function handleIntersection(entries) {
|
||||
if (entry.isVisible === false) {
|
||||
console.log('Element is out of sight ' + entry.intersectionRatio);
|
||||
//console.log(feeds.value[entry.target.id])
|
||||
markRead(feeds.value[entry.target.id].id)
|
||||
markRead(feeds.value[entry.target.id].id).await
|
||||
removeFeed(entry.target.id)
|
||||
// TODO viewport moves crazy
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
function removeFeed(index) {
|
||||
const array = unref(feeds);
|
||||
array.splice(index, 1);
|
||||
}
|
||||
|
||||
let initialLoad = false
|
||||
onMounted(() => {
|
||||
initialLoad = false
|
||||
|
||||
Reference in New Issue
Block a user