Skip to content

Commit

Permalink
fix: avoid trying to resolve names in unsupported chains
Browse files Browse the repository at this point in the history
  • Loading branch information
gleiser-oliveira committed Dec 17, 2024
1 parent 2f50385 commit 0a3f0d8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import getAddressDomainName, {
type GetAddressDomainNameOutput,
} from 'clients/api/queries/getAddressDomainName';
import FunctionKey from 'constants/functionKey';
import { useIsFeatureEnabled } from 'hooks/useIsFeatureEnabled';

type UseGetAddressDomainNameInput = GetAddressDomainNameInput;

Expand All @@ -25,6 +26,7 @@ const useGetAddressDomainName = (
{ accountAddress, chainId }: UseGetAddressDomainNameInput,
options?: Partial<Options>,
) => {
const isWeb3DomainNamesFeatureEnabled = useIsFeatureEnabled({ name: 'web3DomainNames' });
const queryKey: UseGetAddressDomainNameQueryKey = [
FunctionKey.GET_ADDRESS_DOMAIN_NAME,
{
Expand All @@ -37,6 +39,7 @@ const useGetAddressDomainName = (
queryKey: queryKey,
queryFn: () => getAddressDomainName({ accountAddress, chainId }),
...options,
enabled: isWeb3DomainNamesFeatureEnabled && !!options?.enabled,
});
};

Expand Down
1 change: 1 addition & 0 deletions apps/evm/src/hooks/useIsFeatureEnabled/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ export const featureFlags = {
ChainId.OPTIMISM_SEPOLIA,
],
gaslessTransactions: [ChainId.ZKSYNC_SEPOLIA, ChainId.ZKSYNC_MAINNET],
web3DomainNames: [ChainId.BSC_MAINNET, ChainId.ETHEREUM, ChainId.ARBITRUM_ONE],
};

export type FeatureFlag = keyof typeof featureFlags;
Expand Down

0 comments on commit 0a3f0d8

Please sign in to comment.