From 292e8e9bda3bb2b77ed42d4840884ff49f081175 Mon Sep 17 00:00:00 2001 From: Gigi Date: Thu, 16 Oct 2025 01:24:50 +0200 Subject: [PATCH] fix: only show external URLs in Reads if they have reading progress - External URLs with 0% progress are now filtered out - External URLs only appear if readingProgress > 0 OR marked as read - Nostr articles still show even at 0% (bookmarked articles) - Keeps Reads tab focused on actual reading activity for external links --- src/services/readsService.ts | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/services/readsService.ts b/src/services/readsService.ts index 171a78b5..0409776f 100644 --- a/src/services/readsService.ts +++ b/src/services/readsService.ts @@ -251,13 +251,22 @@ export async function fetchAllReads( } } - // 5. Filter out items without timestamps and sort by most recent reading activity + // 5. Filter and sort reads const sortedReads = Array.from(readsMap.values()) .filter(item => { // Only include items that have a timestamp const hasTimestamp = (item.readingTimestamp && item.readingTimestamp > 0) || (item.markedAt && item.markedAt > 0) - return hasTimestamp + if (!hasTimestamp) return false + + // For external URLs, only include if there's reading progress or marked as read + if (item.type === 'external') { + const hasProgress = (item.readingProgress && item.readingProgress > 0) || item.markedAsRead + return hasProgress + } + + // Include all Nostr articles + return true }) .sort((a, b) => { const timeA = a.readingTimestamp || a.markedAt || 0