Commit e398e8b9 authored by Jack Short's avatar Jack Short Committed by GitHub

fix: allow unsupported chain in pwat (#6629)

chore: allow unsupported chain in pwat
parent 6424fdfb
...@@ -3,6 +3,7 @@ import { InterfaceEventName } from '@uniswap/analytics-events' ...@@ -3,6 +3,7 @@ import { InterfaceEventName } from '@uniswap/analytics-events'
import { CurrencyAmount, SupportedChainId, Token } from '@uniswap/sdk-core' import { CurrencyAmount, SupportedChainId, Token } from '@uniswap/sdk-core'
import { UNIVERSAL_ROUTER_ADDRESS } from '@uniswap/universal-router-sdk' import { UNIVERSAL_ROUTER_ADDRESS } from '@uniswap/universal-router-sdk'
import { useWeb3React } from '@web3-react/core' import { useWeb3React } from '@web3-react/core'
import { isSupportedChain } from 'constants/chains'
import usePermit2Allowance, { AllowanceState } from 'hooks/usePermit2Allowance' import usePermit2Allowance, { AllowanceState } from 'hooks/usePermit2Allowance'
import { useCallback, useMemo, useState } from 'react' import { useCallback, useMemo, useState } from 'react'
import invariant from 'tiny-invariant' import invariant from 'tiny-invariant'
...@@ -15,7 +16,7 @@ function getURAddress(chainId?: number, nftURAddress?: string) { ...@@ -15,7 +16,7 @@ function getURAddress(chainId?: number, nftURAddress?: string) {
return nftURAddress ?? UNIVERSAL_ROUTER_ADDRESS(chainId) return nftURAddress ?? UNIVERSAL_ROUTER_ADDRESS(chainId)
} }
return UNIVERSAL_ROUTER_ADDRESS(chainId) return isSupportedChain(chainId) ? UNIVERSAL_ROUTER_ADDRESS(chainId) : undefined
} }
export default function usePermit2Approval( export default function usePermit2Approval(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment