mark all as read

This commit is contained in:
2026-06-08 07:06:38 +02:00
parent b4fc86302f
commit 3c42ebb972
4 changed files with 82 additions and 4 deletions
+13
View File
@@ -159,6 +159,18 @@ function setInitialLoad(value) {
initialLoad = value
}
async function markAllRead() {
if (feeds.value.length === 0) return
if (!window.confirm('Mark all articles as read?')) return
const ids = feeds.value.map(feed => feed.id)
feeds.value = []
currentIndex.value = 0
// markRead swallows its own errors, so Promise.all can't reject here.
await Promise.all(ids.map(id => markRead(id)))
showMessageForXSeconds('All articles marked as read.', 5)
}
function markCurrentArticleRead() {
const feed = feeds.value[currentIndex.value]
// Marking read here (rather than via removeFeed, as the scroll-based list
@@ -203,6 +215,7 @@ export function useFeeds() {
sync,
getReadable,
markRead,
markAllRead,
showMessageForXSeconds,
setupIntersectionObserver,
removeFeed,