diff --git a/packages/extension-ui/src/Popup/Signing/Request/SignArea.tsx b/packages/extension-ui/src/Popup/Signing/Request/SignArea.tsx index 3cad3330..3c317914 100644 --- a/packages/extension-ui/src/Popup/Signing/Request/SignArea.tsx +++ b/packages/extension-ui/src/Popup/Signing/Request/SignArea.tsx @@ -17,11 +17,12 @@ interface Props { error: string | null; isExternal?: boolean; isFirst: boolean; + isSignable: boolean; setError: (value: string | null) => void; signId: string; } -function SignArea ({ buttonText, className, error, isExternal, isFirst, setError, signId }: Props): JSX.Element { +function SignArea ({ buttonText, className, error, isExternal, isFirst, isSignable, setError, signId }: Props): JSX.Element { const [savePass, setSavePass] = useState(false); const [isLocked, setIsLocked] = useState(null); const [password, setPassword] = useState(''); @@ -96,7 +97,7 @@ function SignArea ({ buttonText, className, error, isExternal, isFirst, setError return ( - {isFirst && !isExternal && ( + {isSignable && isFirst && !isExternal && ( <> {isLocked && ( ({ hexBytes: null, payload: null }); const [error, setError] = useState(null); - const { accounts } = useContext(AccountContext); const { t } = useTranslation(); useEffect((): void => { @@ -128,6 +126,7 @@ export default function Request ({ account: { accountIndex, addressOffset, isExt error={error} isExternal={isExternal} isFirst={isFirst} + isSignable setError={setError} signId={signId} /> @@ -135,7 +134,6 @@ export default function Request ({ account: { accountIndex, addressOffset, isExt ); } else if (hexBytes !== null) { const { address, data } = request.payload as SignerPayloadRaw; - const account = accounts.find((account) => decodeAddress(account.address).toString() === decodeAddress(address).toString()); return ( <> @@ -145,33 +143,27 @@ export default function Request ({ account: { accountIndex, addressOffset, isExt isExternal={isExternal} /> - {isExternal && !isHardware && account?.genesisHash - ? ( - - ) - : ( - - ) - } + - {isHardware && <> - {t('Message signing is not supported for hardware wallets.')} - - } + {(isHardware || isExternal) && ( + <> + { + isHardware + ? t('Raw data signing is not supported for hardware wallets.') + : t('Raw data signing is not supported for QR wallets.') + } + + + )} diff --git a/packages/extension/public/locales/en/translation.json b/packages/extension/public/locales/en/translation.json index be58ee6b..cdde3870 100644 --- a/packages/extension/public/locales/en/translation.json +++ b/packages/extension/public/locales/en/translation.json @@ -161,5 +161,8 @@ "I want to export all my accounts": "", "Notifications": "", "Search by name or network...": "", - "Message signing is not supported for hardware wallets.": "" + "Message signing is not supported for hardware wallets.": "", + "Message signing is not supported for QR wallets.": "", + "Raw data signing is not supported for hardware wallets.": "", + "Raw data signing is not supported for QR wallets.": "" }