Skip to content

Commit

Permalink
fix: mark as unread
Browse files Browse the repository at this point in the history
Signed-off-by: Innei <i@innei.in>
  • Loading branch information
Innei committed Jul 8, 2024
1 parent 0a0f71d commit ad91de5
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions src/renderer/src/modules/entry-column/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -114,7 +119,7 @@ export function EntryColumn() {
>
<ListHeader totalCount={virtuosoOptions.totalCount} />
<m.div
key={`${feedId}-${view}`}
key={`${routeFeedId}-${view}`}
className="h-full"
initial={{ opacity: 0.01, y: 100 }}
animate={{ opacity: 1, y: 0 }}
Expand Down Expand Up @@ -224,8 +229,9 @@ const ListHeader: FC<{
{!titleAtBottom && titleInfo}

<div
className={cn("relative z-[1] flex items-center gap-1 self-baseline text-zinc-500", isInCollectionList && "pointer-events-none opacity-0",

className={cn(
"relative z-[1] flex items-center gap-1 self-baseline text-zinc-500",
isInCollectionList && "pointer-events-none opacity-0",
)}
onClick={(e) => e.stopPropagation()}
>
Expand Down

0 comments on commit ad91de5

Please sign in to comment.