diff --git a/packages/mask/src/extension/popups/pages/Wallet/components/WalletInfo/index.tsx b/packages/mask/src/extension/popups/pages/Wallet/components/WalletInfo/index.tsx index 2540b2e3b561..fd366cc5736e 100644 --- a/packages/mask/src/extension/popups/pages/Wallet/components/WalletInfo/index.tsx +++ b/packages/mask/src/extension/popups/pages/Wallet/components/WalletInfo/index.tsx @@ -4,7 +4,7 @@ import { makeStyles } from '@masknet/theme' import { MoreHoriz } from '@mui/icons-material' import { EditIcon, MaskWalletIcon } from '@masknet/icons' import { FormattedAddress } from '@masknet/shared' -import { useHistory, useRouteMatch } from 'react-router-dom' +import { useHistory, useLocation, useRouteMatch } from 'react-router-dom' import { PopupRoutes } from '@masknet/shared-base' import { formatEthereumAddress, useWallet } from '@masknet/web3-shared-evm' import { CopyIconButton } from '../../../../components/CopyIconButton' @@ -66,8 +66,9 @@ const useStyles = makeStyles()({ export const WalletInfo = memo(() => { const wallet = useWallet() const history = useHistory() + const address = new URLSearchParams(useLocation().search).get('address') - const { value: domain } = useReverseAddress(wallet?.address, NetworkPluginID.PLUGIN_EVM) + const { value: domain } = useReverseAddress(address ?? wallet?.address, NetworkPluginID.PLUGIN_EVM) const { Utils } = useWeb3State() const excludePath = useRouteMatch({ diff --git a/packages/mask/src/plugins/EVM/UI/Web3State/index.ts b/packages/mask/src/plugins/EVM/UI/Web3State/index.ts index 1ecdf69d96ac..200c1a3dbb49 100644 --- a/packages/mask/src/plugins/EVM/UI/Web3State/index.ts +++ b/packages/mask/src/plugins/EVM/UI/Web3State/index.ts @@ -103,6 +103,10 @@ export function fixWeb3State(state?: Web3Plugin.ObjectCapabilities.Capabilities, network: chainId, }).reverse(address) + if (isSameAddress(domain, ZERO_ADDRESS) || isSameAddress(domain, ZERO_X_ERROR_ADDRESS)) { + return undefined + } + if (domain) await getStorage().domainAddressBook.setValue({ ...domainAddressBook,