Skip to content

Commit

Permalink
don't try to mark entries that are not markable (#1303)
Browse files Browse the repository at this point in the history
  • Loading branch information
Athou committed Apr 3, 2024
1 parent d610f98 commit 40e1c70
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion commafeed-client/src/app/entries/thunks.ts
Expand Up @@ -64,7 +64,7 @@ export const markEntry = createAppAsyncThunk(
})
},
{
condition: arg => arg.entry.read !== arg.read,
condition: arg => arg.entry.markable && arg.entry.read !== arg.read,
}
)
export const markMultipleEntries = createAppAsyncThunk(
Expand Down
14 changes: 8 additions & 6 deletions commafeed-client/src/components/content/FeedEntryContextMenu.tsx
Expand Up @@ -67,12 +67,14 @@ export function FeedEntryContextMenu(props: FeedEntryContextMenuProps) {
{props.entry.starred ? <Trans>Unstar</Trans> : <Trans>Star</Trans>}
</Group>
</Item>
<Item onClick={async () => await dispatch(markEntry({ entry: props.entry, read: !props.entry.read }))}>
<Group>
{props.entry.read ? <TbEyeOff size={iconSize} /> : <TbEyeCheck size={iconSize} />}
{props.entry.read ? <Trans>Keep unread</Trans> : <Trans>Mark as read</Trans>}
</Group>
</Item>
{props.entry.markable && (
<Item onClick={async () => await dispatch(markEntry({ entry: props.entry, read: !props.entry.read }))}>
<Group>
{props.entry.read ? <TbEyeOff size={iconSize} /> : <TbEyeCheck size={iconSize} />}
{props.entry.read ? <Trans>Keep unread</Trans> : <Trans>Mark as read</Trans>}
</Group>
</Item>
)}
<Item onClick={async () => await dispatch(markEntriesUpToEntry(props.entry))}>
<Group>
<TbArrowBarToDown size={iconSize} />
Expand Down

0 comments on commit 40e1c70

Please sign in to comment.