Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Re-enable wallets, fixed forgetting accounts #6196

Merged
merged 1 commit into from
Jul 31, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions js/src/api/local/accounts/account.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ export default class Account {
}

isValidPassword (password) {
if (!this._keyObject) {
return false;
}

return decryptPrivateKey(this._keyObject, password)
.then((privateKey) => {
if (!privateKey) {
Expand Down
6 changes: 6 additions & 0 deletions js/src/api/local/accounts/accounts.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,12 @@ export default class Accounts {
return false;
}

if (!account.uuid) {
this.removeUnsafe(address);

return true;
}

return account
.isValidPassword(password)
.then((isValid) => {
Expand Down
4 changes: 4 additions & 0 deletions js/src/api/local/localAccountsMiddleware.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
4 changes: 0 additions & 4 deletions js/src/views/Accounts/accounts.js
Original file line number Diff line number Diff line change
Expand Up @@ -373,10 +373,6 @@ class Accounts extends Component {
}

renderNewWalletButton () {
if (this.props.availability !== 'personal') {
return null;
}

return (
<Button
key='newWallet'
Expand Down