don't try to mark entries that are not markable (#1303)

This commit is contained in:
Athou
2024-04-03 15:31:54 +02:00
parent d610f980c7
commit 40e1c70fca
2 changed files with 9 additions and 7 deletions

View File

@@ -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(

View File

@@ -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} />