diff --git a/src/context/WalletProvider/NewWalletViews/wallets/mipd/MipdBody.tsx b/src/context/WalletProvider/NewWalletViews/wallets/mipd/MipdBody.tsx index db222d19b2d..cfdeb0351ae 100644 --- a/src/context/WalletProvider/NewWalletViews/wallets/mipd/MipdBody.tsx +++ b/src/context/WalletProvider/NewWalletViews/wallets/mipd/MipdBody.tsx @@ -3,6 +3,7 @@ import type { InterpolationOptions } from 'node-polyglot' import { useCallback, useMemo } from 'react' import { isMobile } from 'react-device-detect' import { useTranslate } from 'react-polyglot' +import { useSelector } from 'react-redux' import { useHistory } from 'react-router-dom' import { PairBody } from '../../components/PairBody' @@ -20,6 +21,7 @@ import { } from '@/hooks/useIsSnapInstalled/useIsSnapInstalled' import { useWallet } from '@/hooks/useWallet/useWallet' import { METAMASK_RDNS, useMipdProviders } from '@/lib/mipd' +import { selectShowSnapsModal } from '@/state/slices/selectors' import { getSnapVersion } from '@/utils/snaps' type MipdBodyProps = { @@ -39,6 +41,7 @@ export const MipdBody = ({ rdns, isLoading, error, setIsLoading, setError }: Mip () => mipdProviders.find(provider => provider.info.rdns === rdns), [mipdProviders, rdns], ) + const showSnapModal = useSelector(selectShowSnapsModal) const { dispatch, getAdapter } = useWallet() const localWallet = useLocalWallet() @@ -104,7 +107,7 @@ export const MipdBody = ({ rdns, isLoading, error, setIsLoading, setError }: Mip if (isSnapInstalled && !isCorrectVersion) { return history.push('/metamask/snap/update') } - if (!isSnapInstalled) { + if (!isSnapInstalled && showSnapModal) { return history.push('/metamask/snap/install') } @@ -135,6 +138,7 @@ export const MipdBody = ({ rdns, isLoading, error, setIsLoading, setError }: Mip setError, setIsLoading, translate, + showSnapModal, ]) const handleMetamaskRedirect = useCallback(() => {