Skip to content

Commit

Permalink
chore: remove the old navigate to select active source chain card
Browse files Browse the repository at this point in the history
  • Loading branch information
AtelyPham committed Nov 2, 2023
1 parent 8444041 commit bcb11b7
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions apps/bridge-dapp/src/hooks/useConnectButtonProps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ import { WebbError, WebbErrorCodes } from '@webb-tools/dapp-types/WebbError';
import useCurrentTypedChainId from '@webb-tools/react-hooks/useCurrentTypedChainId';
import { useNoteAccount } from '@webb-tools/react-hooks/useNoteAccount';
import { useCallback, useMemo } from 'react';
import { BRIDGE_PATH, SELECT_SOURCE_CHAIN_PATH } from '../constants';
import { useConnectWallet } from './useConnectWallet';
import useNavigateWithPersistParams from './useNavigateWithPersistParams';

function useConnectButtonProps(typedChainId?: number | null) {
const { activeApi = null, activeWallet, switchChain } = useWebContext();
Expand All @@ -17,8 +15,6 @@ function useConnectButtonProps(typedChainId?: number | null) {

const activeTypedChainId = useCurrentTypedChainId();

const navigate = useNavigateWithPersistParams();

const content = useMemo(() => {
if (!activeWallet) {
return 'Connect Wallet' as const;
Expand Down Expand Up @@ -64,7 +60,7 @@ function useConnectButtonProps(typedChainId?: number | null) {
if (nextChainSupported) {
return switchChain(nextChain, activeWallet);
} else {
navigate(`/${BRIDGE_PATH}/${SELECT_SOURCE_CHAIN_PATH}`);
toggleModal(true, typedChainId);
return null;
}
}
Expand All @@ -87,7 +83,7 @@ function useConnectButtonProps(typedChainId?: number | null) {
}
},
// prettier-ignore
[activeApi, activeTypedChainId, activeWallet, hasNoteAccount, navigate, setOpenNoteAccountModal, switchChain, toggleModal]
[activeApi, activeTypedChainId, activeWallet, hasNoteAccount, setOpenNoteAccountModal, switchChain, toggleModal]
);

return {
Expand Down

0 comments on commit bcb11b7

Please sign in to comment.