diff --git a/apps/web/src/components/Staff/SignupContract/Balance.tsx b/apps/web/src/components/Staff/SignupContract/Balance.tsx index d20d77c6e1e7..e47357ce1ee1 100644 --- a/apps/web/src/components/Staff/SignupContract/Balance.tsx +++ b/apps/web/src/components/Staff/SignupContract/Balance.tsx @@ -6,6 +6,7 @@ import { Button, Spinner } from '@hey/ui'; import errorToast from '@lib/errorToast'; import { Leafwatch } from '@lib/leafwatch'; import { type FC, useState } from 'react'; +import useHandleWrongNetwork from 'src/hooks/useHandleWrongNetwork'; import { formatUnits } from 'viem'; import { useBalance, useWriteContract } from 'wagmi'; @@ -13,6 +14,7 @@ import NumberedStat from '../UI/NumberedStat'; const Balance: FC = () => { const [loading, setLoading] = useState(false); + const handleWrongNetwork = useHandleWrongNetwork(); const { data } = useBalance({ address: HEY_LENS_SIGNUP, @@ -32,6 +34,7 @@ const Balance: FC = () => { const withdraw = async () => { try { setLoading(true); + await handleWrongNetwork(); return await writeContractAsync({ abi: HeyLensSignup, diff --git a/apps/web/src/components/Staff/SignupContract/RelayerBalance.tsx b/apps/web/src/components/Staff/SignupContract/RelayerBalance.tsx index ac09d1ef912d..61a4ddeaceca 100644 --- a/apps/web/src/components/Staff/SignupContract/RelayerBalance.tsx +++ b/apps/web/src/components/Staff/SignupContract/RelayerBalance.tsx @@ -8,6 +8,7 @@ import { Button } from '@hey/ui'; import errorToast from '@lib/errorToast'; import { Leafwatch } from '@lib/leafwatch'; import { type FC, useState } from 'react'; +import useHandleWrongNetwork from 'src/hooks/useHandleWrongNetwork'; import { formatUnits, parseEther } from 'viem'; import { useBalance, useReadContract, useSendTransaction } from 'wagmi'; @@ -20,6 +21,7 @@ interface RelayerBalanceProps { const RelayerBalance: FC = ({ address, index }) => { const [loading, setLoading] = useState(false); + const handleWrongNetwork = useHandleWrongNetwork(); const { data } = useBalance({ address: address, @@ -50,6 +52,7 @@ const RelayerBalance: FC = ({ address, index }) => { const refill = async () => { try { setLoading(true); + await handleWrongNetwork(); // Refill balance to 10 MATIC return await sendTransactionAsync({