feat(mobile): pass view parameter to fetch collection (#3202)

This commit is contained in:
Whitewater
2025-03-20 18:30:21 +08:00
committed by GitHub
parent 87110f9fc3
commit b0de460896
+4 -1
View File
@@ -126,6 +126,7 @@ export function useSelectedView() {
function getFetchEntryPayload(
selectedFeed: SelectedTimeline | SelectedFeed,
view: FeedViewType = FeedViewType.Articles,
): FetchEntriesProps | null {
if (!selectedFeed) {
return null
@@ -158,6 +159,7 @@ function getFetchEntryPayload(
const isCollection =
selectedFeed && selectedFeed.type === "feed" && selectedFeed?.feedId === FEED_COLLECTION_LIST
if (isCollection) {
payload.view = view
payload.isCollection = true
}
@@ -174,8 +176,9 @@ export function useSelectedFeed() {
export function useFetchEntriesControls() {
const selectedFeed = useSelectedFeed()
const view = useSelectedView()
const payload = getFetchEntryPayload(selectedFeed)
const payload = getFetchEntryPayload(selectedFeed, view)
return usePrefetchEntries(payload)
}