Select, don't mutate (#4541)
parent
ba2fadb661
commit
f5f3bd8130
|
@ -234,8 +234,12 @@ export function useGetPopularFeedsQuery(options?: GetPopularFeedsOptions) {
|
|||
data: InfiniteData<AppBskyUnspeccedGetPopularFeedGenerators.OutputSchema>,
|
||||
) => {
|
||||
const {savedFeeds, hasSession: hasSessionInner} = selectArgs
|
||||
data?.pages.map(page => {
|
||||
page.feeds = page.feeds.filter(feed => {
|
||||
return {
|
||||
...data,
|
||||
pages: data.pages.map(page => {
|
||||
return {
|
||||
...page,
|
||||
feeds: page.feeds.filter(feed => {
|
||||
if (
|
||||
!hasSessionInner &&
|
||||
KNOWN_AUTHED_ONLY_FEEDS.includes(feed.uri)
|
||||
|
@ -248,12 +252,10 @@ export function useGetPopularFeedsQuery(options?: GetPopularFeedsOptions) {
|
|||
}),
|
||||
)
|
||||
return !alreadySaved
|
||||
})
|
||||
|
||||
return page
|
||||
})
|
||||
|
||||
return data
|
||||
}),
|
||||
}
|
||||
}),
|
||||
}
|
||||
},
|
||||
[selectArgs /* Don't change. Everything needs to go into selectArgs. */],
|
||||
),
|
||||
|
|
Loading…
Reference in New Issue