clicking on the body of an entry in expanded mode selects it and marks it as read (#1089)

This commit is contained in:
Athou
2023-06-21 20:29:18 +02:00
parent 877fc33180
commit 6a5052787d
2 changed files with 15 additions and 1 deletions

View File

@@ -59,6 +59,18 @@ export function FeedEntries() {
}
}
const bodyClicked = (entry: ExpendableEntry) => {
if (viewMode !== "expanded") return
dispatch(
selectEntry({
entry,
expand: true,
markAsRead: true,
scrollToEntry: true,
})
)
}
const swipedRight = (entry: ExpendableEntry) => dispatch(markEntry({ entry, read: !entry.read }))
useEffect(() => {
@@ -272,6 +284,7 @@ export function FeedEntries() {
showSelectionIndicator={entry.id === selectedEntryId && (!entry.expanded || viewMode === "expanded")}
maxWidth={sidebarVisible ? Constants.layout.entryMaxWidth : undefined}
onHeaderClick={event => headerClicked(entry, event)}
onBodyClick={() => bodyClicked(entry)}
onSwipedRight={() => swipedRight(entry)}
/>
</div>