Skip to content

Commit

Permalink
Update AddressInterface.tsx
Browse files Browse the repository at this point in the history
  • Loading branch information
mateodaza committed Dec 9, 2024
1 parent ae8d70b commit ed25c16
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/components/views/create/AddressInterface.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { useState } from 'react';
import { useFormContext } from 'react-hook-form';
import { useIntl } from 'react-intl';
import { useAccount, useSwitchChain } from 'wagmi';
Expand Down Expand Up @@ -57,6 +58,10 @@ const AddressInterface = ({
const { formatMessage } = useIntl();
const { isOnEVM } = useGeneralWallet();

const [hasAnchorContract, setHasAnchorContract] = useState(
anchorContractData?.isActive || false,
);

const isOnOptimism = chain
? chain.id === config.OPTIMISM_NETWORK_NUMBER
: false;
Expand All @@ -74,7 +79,7 @@ const AddressInterface = ({
const walletAddress = addressObj?.address;

const hasAddress = !!walletAddress;
const hasAnchorContract = !!anchorContractData?.isActive;

const hasOptimismAddress = !!findAddressByChain(
value,
config.OPTIMISM_NETWORK_NUMBER,
Expand Down Expand Up @@ -250,7 +255,7 @@ const AddressInterface = ({
recipientAddress:
walletAddress || value,
});
// update here so it shows it already has a contract
setHasAnchorContract(true);
}}
/>
</EnableBtn>
Expand Down

0 comments on commit ed25c16

Please sign in to comment.