mirror of
https://github.com/Athou/commafeed.git
synced 2026-03-21 21:37:29 +00:00
fix loadMoreEntries for tags
This commit is contained in:
@@ -59,15 +59,17 @@ export const loadEntries = createAsyncThunk<Entries, EntrySource, { state: RootS
|
|||||||
})
|
})
|
||||||
export const loadMoreEntries = createAsyncThunk<Entries, void, { state: RootState }>("entries/loadMore", async (_, thunkApi) => {
|
export const loadMoreEntries = createAsyncThunk<Entries, void, { state: RootState }>("entries/loadMore", async (_, thunkApi) => {
|
||||||
const state = thunkApi.getState()
|
const state = thunkApi.getState()
|
||||||
|
const { source } = state.entries
|
||||||
const offset =
|
const offset =
|
||||||
state.user.settings?.readingMode === "all" ? state.entries.entries.length : state.entries.entries.filter(e => !e.read).length
|
state.user.settings?.readingMode === "all" ? state.entries.entries.length : state.entries.entries.filter(e => !e.read).length
|
||||||
const endpoint = getEndpoint(state.entries.source.type)
|
const endpoint = getEndpoint(state.entries.source.type)
|
||||||
const result = await endpoint({
|
const result = await endpoint({
|
||||||
id: state.entries.source.id,
|
id: source.type === "tag" ? Constants.categories.all.id : source.id,
|
||||||
readType: state.user.settings?.readingMode,
|
readType: state.user.settings?.readingMode,
|
||||||
order: state.user.settings?.readingOrder,
|
order: state.user.settings?.readingOrder,
|
||||||
offset,
|
offset,
|
||||||
limit: 50,
|
limit: 50,
|
||||||
|
tag: source.type === "tag" ? source.id : undefined,
|
||||||
})
|
})
|
||||||
return result.data
|
return result.data
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user