Skip to content

Commit

Permalink
fix: save mm dont show snap install again
Browse files Browse the repository at this point in the history
  • Loading branch information
NeOMakinG committed Mar 6, 2025
1 parent 1f00c36 commit b84cda3
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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 = {
Expand All @@ -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()
Expand Down Expand Up @@ -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')
}

Expand Down Expand Up @@ -135,6 +138,7 @@ export const MipdBody = ({ rdns, isLoading, error, setIsLoading, setError }: Mip
setError,
setIsLoading,
translate,
showSnapModal,
])

const handleMetamaskRedirect = useCallback(() => {
Expand Down

0 comments on commit b84cda3

Please sign in to comment.