Skip to content

Commit

Permalink
hooks/campaigns.ts: Disable useCampaignList on client (#1568)
Browse files Browse the repository at this point in the history
Campaigns' data is prefetched on the server, and since campaign's data is no longer stale, it results in 2 queries to the server being made.
Due to the call of useCampaignList twice, the campaigns are being reordered twice - once on the server, once on client load, which makes it unpleasant for the users
  • Loading branch information
sashko9807 authored Aug 23, 2023
1 parent 35ef946 commit d562d11
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/common/hooks/campaigns.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ export function useCampaignList() {
return useQuery<CampaignResponse[]>(
[endpoints.campaign.listCampaigns.url],
campaignsOrderQueryFunction,
{ enabled: false },
)
}

Expand Down

0 comments on commit d562d11

Please sign in to comment.