From ad91de57f4df2868b9a76db1a518c917027f5470 Mon Sep 17 00:00:00 2001 From: Innei Date: Mon, 8 Jul 2024 15:00:54 +0800 Subject: [PATCH] fix: mark as unread Signed-off-by: Innei --- .../src/modules/entry-column/index.tsx | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/src/renderer/src/modules/entry-column/index.tsx b/src/renderer/src/modules/entry-column/index.tsx index 8304b37141..081ff1358b 100644 --- a/src/renderer/src/modules/entry-column/index.tsx +++ b/src/renderer/src/modules/entry-column/index.tsx @@ -63,15 +63,20 @@ export function EntryColumn() { const entries = useEntriesByView() const { entriesIds, isFetchingNextPage } = entries - const { entryId: activeEntryId, view, feedId } = useRouteParms() + const { entryId: activeEntryId, view, feedId: routeFeedId } = useRouteParms() const activeEntry = useEntry(activeEntryId) useEffect(() => { - if (!feedId || !activeEntryId) return - if (activeEntryId === ROUTE_ENTRY_PENDING || feedId === FEED_COLLECTION_LIST || feedId === ROUTE_FEED_PENDING) return + if (!activeEntryId) return + if ( + activeEntryId === ROUTE_ENTRY_PENDING || + routeFeedId === FEED_COLLECTION_LIST + ) { return } + const feedId = activeEntry?.feeds.id + if (!feedId) return batchMarkUnread([feedId, activeEntryId]) - }, [activeEntry, activeEntryId, feedId]) + }, [activeEntry, activeEntryId, routeFeedId]) const handleMarkReadInRange = useEntryMarkReadHandler(entriesIds) @@ -114,7 +119,7 @@ export function EntryColumn() { > e.stopPropagation()} >