diff --git a/apps/mobile/src/store/entry/hooks.ts b/apps/mobile/src/store/entry/hooks.ts index 8aee109a8..3bd0bc324 100644 --- a/apps/mobile/src/store/entry/hooks.ts +++ b/apps/mobile/src/store/entry/hooks.ts @@ -9,10 +9,10 @@ import { entrySyncServices, useEntryStore } from "./store" import type { EntryModel, FetchEntriesProps } from "./types" export const usePrefetchEntries = (props: Omit | null) => { - const { feedId, inboxId, listId, view, limit } = props || {} + const { feedId, inboxId, listId, view, limit, feedIdList } = props || {} const unreadOnly = useGeneralSettingKey("unreadOnly") return useInfiniteQuery({ - queryKey: ["entries", feedId, inboxId, listId, view, unreadOnly, limit], + queryKey: ["entries", feedId, inboxId, listId, view, unreadOnly, limit, feedIdList], queryFn: ({ pageParam }) => entrySyncServices.fetchEntries({ ...props, pageParam, read: unreadOnly ? false : undefined }), getNextPageParam: (lastPage) => lastPage.data?.at(-1)?.entries.publishedAt, diff --git a/apps/mobile/src/store/entry/store.ts b/apps/mobile/src/store/entry/store.ts index c991a38dd..165f7c302 100644 --- a/apps/mobile/src/store/entry/store.ts +++ b/apps/mobile/src/store/entry/store.ts @@ -342,12 +342,14 @@ class EntryActions { class EntrySyncServices { async fetchEntries(props: FetchEntriesProps) { - const { feedId, inboxId, listId, view, read, limit, pageParam, isCollection } = props + const { feedId, inboxId, listId, view, read, limit, pageParam, isCollection, feedIdList } = + props const params = getEntriesParams({ feedId, inboxId, listId, view, + feedIdList, }) const res = params.inboxId ? await apiClient.entries.inbox.$post({ diff --git a/apps/mobile/src/store/entry/utils.ts b/apps/mobile/src/store/entry/utils.ts index 1776339e6..3287ef838 100644 --- a/apps/mobile/src/store/entry/utils.ts +++ b/apps/mobile/src/store/entry/utils.ts @@ -19,11 +19,13 @@ export function getEntriesParams({ inboxId, listId, view, + feedIdList, }: { feedId?: number | string inboxId?: number | string listId?: number | string view?: number + feedIdList?: string[] }) { const params: { feedId?: string @@ -37,6 +39,8 @@ export function getEntriesParams({ params.inboxId = `${inboxId}` } else if (listId) { params.listId = `${listId}` + } else if (feedIdList) { + params.feedIdList = feedIdList } else if (feedId) { if (feedId === FEED_COLLECTION_LIST) { params.isCollection = true