Sort profile feedgens by likes (#4380)
* Sort profile feedgens by likes
* Sort entire set as we get more pages
* Nah
This reverts commit 3b8714fd97.
* Update profile-feedgens.ts
---------
Co-authored-by: dan <dan.abramov@gmail.com>
This commit is contained in:
@@ -3,7 +3,7 @@ import {InfiniteData, QueryKey, useInfiniteQuery} from '@tanstack/react-query'
|
||||
|
||||
import {useAgent} from '#/state/session'
|
||||
|
||||
const PAGE_SIZE = 30
|
||||
const PAGE_SIZE = 50
|
||||
type RQPageParam = string | undefined
|
||||
|
||||
// TODO refactor invalidate on mutate?
|
||||
@@ -30,6 +30,9 @@ export function useProfileFeedgensQuery(
|
||||
limit: PAGE_SIZE,
|
||||
cursor: pageParam,
|
||||
})
|
||||
res.data.feeds.sort((a, b) => {
|
||||
return (b.likeCount || 0) - (a.likeCount || 0)
|
||||
})
|
||||
return res.data
|
||||
},
|
||||
initialPageParam: undefined,
|
||||
|
||||
Reference in New Issue
Block a user