From 458953d24416ac107506c9e0d63a5132647f751b Mon Sep 17 00:00:00 2001 From: Paulo Amorim Date: Mon, 28 Oct 2024 17:03:25 -0300 Subject: [PATCH] Set enabled property from reactQuery --- jsapp/js/account/stripe.api.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/jsapp/js/account/stripe.api.ts b/jsapp/js/account/stripe.api.ts index eb0989d449..23f8476de5 100644 --- a/jsapp/js/account/stripe.api.ts +++ b/jsapp/js/account/stripe.api.ts @@ -98,9 +98,12 @@ export const useOrganizationQuery = () => { }; }; + // Setting the 'enabled' property so the query won't run until we have the session data + // loaded. Account data is needed to fetch the organization data. return useQuery({ queryFn: fetchOrganization, queryKey: [QueryKeys.organization], + enabled: !sessionStore.isPending && sessionStore.isInitialLoadComplete, }); };