1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-10-22 19:26:13 +02:00

Clear the clipboard after seed phrase is pasted (Restore vault) (#12987)

This commit is contained in:
ryanml 2021-12-06 12:17:56 -07:00 committed by Dan Miller
parent 6adb48d9f0
commit f4ce5bfb6f

View File

@ -10,6 +10,7 @@ import {
import { DEFAULT_ROUTE } from '../../helpers/constants/routes'; import { DEFAULT_ROUTE } from '../../helpers/constants/routes';
import TextField from '../../components/ui/text-field'; import TextField from '../../components/ui/text-field';
import Button from '../../components/ui/button'; import Button from '../../components/ui/button';
import { clearClipboard } from '../../helpers/utils/util';
const { isValidMnemonic } = ethers.utils; const { isValidMnemonic } = ethers.utils;
@ -173,6 +174,7 @@ class RestoreVaultPage extends Component {
{showSeedPhrase ? ( {showSeedPhrase ? (
<textarea <textarea
className="import-account__secret-phrase" className="import-account__secret-phrase"
onPaste={clearClipboard}
onChange={(e) => this.handleSeedPhraseChange(e.target.value)} onChange={(e) => this.handleSeedPhraseChange(e.target.value)}
value={seedPhrase} value={seedPhrase}
autoFocus autoFocus
@ -182,6 +184,7 @@ class RestoreVaultPage extends Component {
<TextField <TextField
className="import-account__textarea import-account__seedphrase" className="import-account__textarea import-account__seedphrase"
type="password" type="password"
onPaste={clearClipboard}
onChange={(e) => this.handleSeedPhraseChange(e.target.value)} onChange={(e) => this.handleSeedPhraseChange(e.target.value)}
value={seedPhrase} value={seedPhrase}
autoFocus autoFocus