From c1893a6bc7a436189a24d772ac57580297d35bb2 Mon Sep 17 00:00:00 2001 From: Fionna Chan <13184582+fionnachan@users.noreply.github.com> Date: Thu, 19 Sep 2024 19:01:22 +0800 Subject: [PATCH] refactor: remove wrong network toast code (#1907) --- .../TransferPanel/TransferPanel.tsx | 30 +------------------ 1 file changed, 1 insertion(+), 29 deletions(-) diff --git a/packages/arb-token-bridge-ui/src/components/TransferPanel/TransferPanel.tsx b/packages/arb-token-bridge-ui/src/components/TransferPanel/TransferPanel.tsx index aacdb3dbee..ffe2d2519e 100644 --- a/packages/arb-token-bridge-ui/src/components/TransferPanel/TransferPanel.tsx +++ b/packages/arb-token-bridge-ui/src/components/TransferPanel/TransferPanel.tsx @@ -34,9 +34,8 @@ import { useSwitchNetworkWithConfig } from '../../hooks/useSwitchNetworkWithConf import { useIsConnectedToArbitrum } from '../../hooks/useIsConnectedToArbitrum' import { useIsConnectedToOrbitChain } from '../../hooks/useIsConnectedToOrbitChain' import { errorToast, warningToast } from '../common/atoms/Toast' -import { ExternalLink } from '../common/ExternalLink' import { useAccountType } from '../../hooks/useAccountType' -import { DOCS_DOMAIN, GET_HELP_LINK } from '../../constants' +import { DOCS_DOMAIN } from '../../constants' import { AdvancedSettings, useDestinationAddressStore @@ -83,18 +82,6 @@ import { useIsBatchTransferSupported } from '../../hooks/TransferPanel/useIsBatc import { normalizeTimestamp } from '../../state/app/utils' import { getDestinationAddressError } from './hooks/useDestinationAddressError' -const networkConnectionWarningToast = () => - warningToast( - <> - Network connection issue. Please contact{' '} - - support - - . - , - { autoClose: false } - ) - export function TransferPanel() { const { tokenFromSearchParams, setTokenQueryParam } = useTokenFromSearchParams() @@ -685,21 +672,6 @@ export function TransferPanel() { const sourceChainId = latestNetworks.current.sourceChain.id const destinationChainId = latestNetworks.current.destinationChain.id - const connectedChainId = networks.sourceChain.id - const sourceChainEqualsConnectedChain = sourceChainId === connectedChainId - - // Transfer is invalid if the connected chain doesn't mismatches source-destination chain requirements - const depositNetworkConnectionWarning = - isDepositMode && - (!sourceChainEqualsConnectedChain || isConnectedToOrbitChain.current) - const withdrawalNetworkConnectionWarning = - !isDepositMode && !sourceChainEqualsConnectedChain - if ( - depositNetworkConnectionWarning || - withdrawalNetworkConnectionWarning - ) { - return networkConnectionWarningToast() - } const sourceChainErc20Address = isDepositMode ? selectedToken?.address