Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions packages/common/src/api/tan-query/remixes/useRemixes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,10 +169,10 @@ export const useRemixes = (
}

/**
* Count-only companion to `useRemixes`. Hits the same SDK endpoint with
* `limit=0` and stores just the total under a separate query key so the
* lineup query can keep its standard `LineupData[]` page shape (which is
* what `TrackLineup` / `playFrom`'s `querySource` requires).
* Count companion to `useRemixes`. Hits the same SDK endpoint and stores
* just the total under a separate query key so the lineup query can keep
* its standard `LineupData[]` page shape (which is what `TrackLineup` /
* `playFrom`'s `querySource` requires).
*/
export const useRemixesCount = (
{ trackId, isCosign = false, isContestEntry = false }: UseRemixesCountArgs,
Expand All @@ -189,7 +189,11 @@ export const useRemixesCount = (
const remixesResponse = await sdk.tracks.getTrackRemixes({
trackId: Id.parse(trackId),
userId: OptionalId.parse(currentUserId),
limit: 0,
// Fetch one item so the count follows the same API path as the
// paginated remix list. Some nodes do not treat limit=0 as a
// reliable count-only request, which can make contest pages show
// "Submissions (0)" while the list below has entries.
limit: 1,
offset: 0,
onlyCosigns: isCosign,
onlyContestEntries: isContestEntry
Expand Down
Loading