mirror of
https://github.com/Athou/commafeed.git
synced 2026-03-21 21:37:29 +00:00
clicking on the body of an entry in expanded mode selects it and marks it as read (#1089)
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user