From d562d1181ecb3ef9b8719f71d3e3030adfb75150 Mon Sep 17 00:00:00 2001 From: Aleksandar Petkov Date: Wed, 23 Aug 2023 16:28:53 +0300 Subject: [PATCH] hooks/campaigns.ts: Disable useCampaignList on client (#1568) 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 --- src/common/hooks/campaigns.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/common/hooks/campaigns.ts b/src/common/hooks/campaigns.ts index ec1add876..e11db3ba1 100644 --- a/src/common/hooks/campaigns.ts +++ b/src/common/hooks/campaigns.ts @@ -43,6 +43,7 @@ export function useCampaignList() { return useQuery( [endpoints.campaign.listCampaigns.url], campaignsOrderQueryFunction, + { enabled: false }, ) }