Re-enable wallets, fixed forgetting accounts

This commit is contained in:
maciejhirsz 2017-07-31 17:51:23 +02:00
parent 003eef982b
commit 2ca4adb62c
4 changed files with 14 additions and 4 deletions

View File

@ -31,6 +31,10 @@ export default class Account {
}
isValidPassword (password) {
if (!this._keyObject) {
return false;
}
return decryptPrivateKey(this._keyObject, password)
.then((privateKey) => {
if (!privateKey) {

View File

@ -168,6 +168,12 @@ export default class Accounts {
return false;
}
if (!account.uuid) {
this.removeUnsafe(address);
return true;
}
return account
.isValidPassword(password)
.then((isValid) => {

View File

@ -206,6 +206,10 @@ export default class LocalAccountsMiddleware extends Middleware {
return accounts.remove(address, password);
});
register('parity_removeAddress', ([address]) => {
return accounts.remove(address, null);
});
register('parity_testPassword', ([address, password]) => {
const account = accounts.get(address);

View File

@ -373,10 +373,6 @@ class Accounts extends Component {
}
renderNewWalletButton () {
if (this.props.availability !== 'personal') {
return null;
}
return (
<Button
key='newWallet'