mirror of
https://github.com/Athou/commafeed.git
synced 2026-11-03 10:54:46 +00:00
fix "Mark all as read" ignoring active search filter (#2354)
This commit is contained in:
@@ -40,9 +40,7 @@ export const loadMoreEntries = createAppAsyncThunk("entries/loadMore", async (_,
|
|||||||
const state = thunkApi.getState()
|
const state = thunkApi.getState()
|
||||||
const { source } = state.entries
|
const { source } = state.entries
|
||||||
const offset =
|
const offset =
|
||||||
state.user.settings?.readingMode === "all" ||
|
state.user.settings?.readingMode === "all" || state.entries.search || (source.type === "category" && source.id === "starred")
|
||||||
state.entries.search ||
|
|
||||||
(source.type === "category" && source.id === "starred")
|
|
||||||
? state.entries.entries.length
|
? state.entries.entries.length
|
||||||
: state.entries.entries.filter(e => !e.read).length
|
: state.entries.entries.filter(e => !e.read).length
|
||||||
const endpoint = getEndpoint(state.entries.source.type)
|
const endpoint = getEndpoint(state.entries.source.type)
|
||||||
@@ -139,6 +137,7 @@ export const markAllAsReadWithConfirmationIfRequired = createAppAsyncThunk(
|
|||||||
const state = thunkApi.getState()
|
const state = thunkApi.getState()
|
||||||
const source = state.entries.source
|
const source = state.entries.source
|
||||||
const entriesTimestamp = state.entries.timestamp ?? Date.now()
|
const entriesTimestamp = state.entries.timestamp ?? Date.now()
|
||||||
|
const search = state.entries.search
|
||||||
const markAllAsReadConfirmation = state.user.settings?.markAllAsReadConfirmation
|
const markAllAsReadConfirmation = state.user.settings?.markAllAsReadConfirmation
|
||||||
const markAllAsReadNavigateToNextUnread = state.user.settings?.markAllAsReadNavigateToNextUnread
|
const markAllAsReadNavigateToNextUnread = state.user.settings?.markAllAsReadNavigateToNextUnread
|
||||||
|
|
||||||
@@ -153,6 +152,7 @@ export const markAllAsReadWithConfirmationIfRequired = createAppAsyncThunk(
|
|||||||
read: true,
|
read: true,
|
||||||
olderThan: Date.now(),
|
olderThan: Date.now(),
|
||||||
insertedBefore: entriesTimestamp,
|
insertedBefore: entriesTimestamp,
|
||||||
|
keywords: search,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ export function MarkAllAsReadConfirmationDialog() {
|
|||||||
const source = useAppSelector(state => state.entries.source)
|
const source = useAppSelector(state => state.entries.source)
|
||||||
const sourceLabel = useAppSelector(state => state.entries.sourceLabel)
|
const sourceLabel = useAppSelector(state => state.entries.sourceLabel)
|
||||||
const entriesTimestamp = useAppSelector(state => state.entries.timestamp) ?? Date.now()
|
const entriesTimestamp = useAppSelector(state => state.entries.timestamp) ?? Date.now()
|
||||||
|
const search = useAppSelector(state => state.entries.search)
|
||||||
const markAllAsReadNavigateToNextUnread = useAppSelector(state => state.user.settings?.markAllAsReadNavigateToNextUnread)
|
const markAllAsReadNavigateToNextUnread = useAppSelector(state => state.user.settings?.markAllAsReadNavigateToNextUnread)
|
||||||
const dispatch = useAppDispatch()
|
const dispatch = useAppDispatch()
|
||||||
|
|
||||||
@@ -26,6 +27,7 @@ export function MarkAllAsReadConfirmationDialog() {
|
|||||||
read: true,
|
read: true,
|
||||||
olderThan: Date.now() - threshold * 24 * 60 * 60 * 1000,
|
olderThan: Date.now() - threshold * 24 * 60 * 60 * 1000,
|
||||||
insertedBefore: entriesTimestamp,
|
insertedBefore: entriesTimestamp,
|
||||||
|
keywords: search,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user