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) { isValidPassword (password) {
if (!this._keyObject) {
return false;
}
return decryptPrivateKey(this._keyObject, password) return decryptPrivateKey(this._keyObject, password)
.then((privateKey) => { .then((privateKey) => {
if (!privateKey) { if (!privateKey) {

View File

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

View File

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

View File

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