diff options
author | Eric Bailey <git@esb.lol> | 2024-06-10 20:55:44 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-11 03:55:44 +0200 |
commit | 14cddb7ec0a6088b5f2f89f61fc2a32656756f7a (patch) | |
tree | 28a8c887e5a18fb80a665a6e0777c8e524962ee0 /src | |
parent | 848151c4f96dd0e60feb8c5845da2970425ce968 (diff) | |
download | voidsky-14cddb7ec0a6088b5f2f89f61fc2a32656756f7a.tar.zst |
Sort profile feedgens by likes (#4380)
* Sort profile feedgens by likes * Sort entire set as we get more pages * Nah This reverts commit 3b8714fd97bb113cfd8c588d5cdfd063d395f553. * Update profile-feedgens.ts --------- Co-authored-by: dan <dan.abramov@gmail.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/state/queries/profile-feedgens.ts | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/state/queries/profile-feedgens.ts b/src/state/queries/profile-feedgens.ts index e2508f994..8ad12ab61 100644 --- a/src/state/queries/profile-feedgens.ts +++ b/src/state/queries/profile-feedgens.ts @@ -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, |