diff --git a/commafeed-client/src/components/header/MarkAllAsReadButton.tsx b/commafeed-client/src/components/header/MarkAllAsReadButton.tsx index 6be43aa6..3f0842db 100644 --- a/commafeed-client/src/components/header/MarkAllAsReadButton.tsx +++ b/commafeed-client/src/components/header/MarkAllAsReadButton.tsx @@ -36,6 +36,21 @@ export function MarkAllAsReadButton(props: { iconSize: number }) { } } + const onConfirm = () => { + setOpened(false) + dispatch( + markAllEntries({ + sourceType: source.type, + req: { + id: source.id, + read: true, + olderThan: Date.now() - threshold * 24 * 60 * 60 * 1000, + insertedBefore: entriesTimestamp, + }, + }) + ) + } + return ( <> setOpened(false)} title={Mark all entries as read}> @@ -66,28 +81,13 @@ export function MarkAllAsReadButton(props: { iconSize: number }) { value={threshold} onChange={setThreshold} data-autofocus + onKeyDown={e => e.key === "Enter" && onConfirm()} /> -