Skip to content

Commit

Permalink
fix: dont check for fuul url for affiliates metadata queries (#1332)
Browse files Browse the repository at this point in the history
  • Loading branch information
tinaszheng authored Nov 25, 2024
1 parent 08e04d8 commit 7bbbe3d
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/hooks/useAffiliatesInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import { safeFetch } from '@/lib/safeFetch';
import { log } from '@/lib/telemetry';

import { useDydxClient } from './useDydxClient';
import { useEndpointsConfig } from './useEndpointsConfig';

type AffiliatesMetadata = {
referralCode: string;
Expand All @@ -27,7 +26,6 @@ type AffiliatesMetadata = {
export const useAffiliatesInfo = (dydxAddress?: string) => {
const { compositeClient, getAffiliateInfo, getAllAffiliateTiers } = useDydxClient();
const feeTiers = useAppSelector(getFeeTiers, shallowEqual);
const { affiliatesBaseUrl } = useEndpointsConfig();

const fetchAffiliateMetadata = async () => {
if (!compositeClient || !dydxAddress) {
Expand Down Expand Up @@ -90,7 +88,7 @@ export const useAffiliatesInfo = (dydxAddress?: string) => {
const affiliateMetadataQuery = useQuery({
queryKey: ['affiliateMetadata', dydxAddress],
queryFn: fetchAffiliateMetadata,
enabled: Boolean(compositeClient && dydxAddress && affiliatesBaseUrl),
enabled: Boolean(compositeClient && dydxAddress),
staleTime: 5 * timeUnits.minute,
});

Expand All @@ -117,7 +115,7 @@ export const useAffiliatesInfo = (dydxAddress?: string) => {
const affiliateMaxEarningQuery = useQuery({
queryKey: ['affiliateMaxEarning', feeTiers],
queryFn: fetchAffiliateMaxEarning,
enabled: Boolean(compositeClient && feeTiers && affiliatesBaseUrl),
enabled: Boolean(compositeClient && feeTiers),
staleTime: Infinity,
});

Expand Down

0 comments on commit 7bbbe3d

Please sign in to comment.