Skip to content

Commit 2cc37c3

Browse files
dylanjeffersclaude
andauthored
fix: mobile contest followers list shows blank (#14316)
## Summary - The `enabled` option in `useEventFollowers` was placed BEFORE the `...options` spread, so any caller passing an explicit `enabled` (e.g. `ContestFollowersModal` with `{ enabled: isOpen }`) silently overrode the `!!eventId` guard. - Moved the `enabled` line AFTER the spread and combined the eventId guard with the caller's value: `enabled: !!eventId && (options?.enabled ?? true)`. The eventId check now always wins, so the query can never run with a null event id. ## Test plan - [ ] Open a remix contest page on mobile - [ ] Tap the "Followers (N)" card to push the dedicated followers screen - [ ] Confirm the followers list renders (avatars + handles) instead of staying blank - [ ] Confirm the avatar pile on the contest details tab still renders - [ ] On web, open the contest followers modal and confirm it still loads correctly (caller passes `{ enabled: isOpen }`) - [ ] Follow / unfollow an event and confirm the avatar pile updates (existing invalidation path) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 19696ab commit 2cc37c3

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

packages/common/src/api/tan-query/events/useEventFollowers.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ export const useEventFollowers = (
4040

4141
const queryRes = useQuery({
4242
queryKey: getEventFollowersQueryKey({ eventId, limit }),
43-
enabled: options?.enabled !== false && !!eventId,
4443
queryFn: async (): Promise<ID[]> => {
4544
if (!eventId) return []
4645
try {
@@ -63,7 +62,8 @@ export const useEventFollowers = (
6362
return []
6463
}
6564
},
66-
...options
65+
...options,
66+
enabled: !!eventId && (options?.enabled ?? true)
6767
})
6868

6969
const { data: users } = useUsers(queryRes.data)

0 commit comments

Comments
 (0)