diff --git a/src/renderer/shared/components/NewWallet/Import/ExistingImport/ExistingImport.js b/src/renderer/shared/components/NewWallet/Import/ExistingImport/ExistingImport.js index 83367ad9b..98dbf21c3 100644 --- a/src/renderer/shared/components/NewWallet/Import/ExistingImport/ExistingImport.js +++ b/src/renderer/shared/components/NewWallet/Import/ExistingImport/ExistingImport.js @@ -18,7 +18,9 @@ export default class ExistingImport extends React.PureComponent { className: string, account: accountShape.isRequired, passphrase: string.isRequired, + legacyPassphrase: string.isRequired, setPassphrase: func.isRequired, + setLegacyPassphrase: func.isRequired, addAccount: func.isRequired, accounts: arrayOf(legacyAccountShape).isRequired, setCurrentAccount: func.isRequired, @@ -31,7 +33,7 @@ export default class ExistingImport extends React.PureComponent { }; render() { - const { className, accounts, passphrase, currentAccount } = this.props; + const { className, accounts, passphrase, legacyPassphrase, currentAccount } = this.props; return (
@@ -45,10 +47,19 @@ export default class ExistingImport extends React.PureComponent { /> + + @@ -60,6 +71,10 @@ export default class ExistingImport extends React.PureComponent { this.props.setPassphrase(event.target.value); }; + handleChangeLegacyPassphrase = (event) => { + this.props.setLegacyPassphrase(event.target.value); + }; + handleChangeCurrentAccount = (value) => { this.props.setCurrentAccount(value); }; @@ -72,13 +87,14 @@ export default class ExistingImport extends React.PureComponent { setPassphrase, addAccount, showErrorToast, + legacyPassphrase, currentAccount } = this.props; const walletLabel = accounts.filter((acc) => acc.encryptedKey === currentAccount)[0].walletName; try { - const wif = await wallet.decryptAsync(currentAccount, passphrase); + const wif = await wallet.decryptAsync(currentAccount, legacyPassphrase); const { privateKey } = new wallet.Account(wif); const options = { @@ -92,7 +108,7 @@ export default class ExistingImport extends React.PureComponent { addAccount({ account, passphrase, options }); setPassphrase(''); } catch (e) { - showErrorToast(`Wrong passphrase for account ${walletLabel}`); + showErrorToast(`Incorrect legacy passphrase for account ${walletLabel}`); } }; diff --git a/src/renderer/shared/components/NewWallet/Import/ExistingImport/index.js b/src/renderer/shared/components/NewWallet/Import/ExistingImport/index.js index 62cb330a0..e0cb8b84c 100644 --- a/src/renderer/shared/components/NewWallet/Import/ExistingImport/index.js +++ b/src/renderer/shared/components/NewWallet/Import/ExistingImport/index.js @@ -19,6 +19,7 @@ export default compose( withState('currentAccount', 'setCurrentAccount', ({ accounts }) => { return accounts[0] && accounts[0].encryptedKey; }), + withState('legacyPassphrase', 'setLegacyPassphrase', ''), withState('passphrase', 'setPassphrase', ''), withErrorToast(),