Skip to content

Commit

Permalink
Set enabled property from reactQuery
Browse files Browse the repository at this point in the history
  • Loading branch information
pauloamorimbr committed Oct 28, 2024
1 parent 78d2cd7 commit 458953d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions jsapp/js/account/stripe.api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
});
};

Expand Down

0 comments on commit 458953d

Please sign in to comment.