diff options
author | brunobar79 <brunobar79@gmail.com> | 2018-07-11 12:20:40 +0800 |
---|---|---|
committer | brunobar79 <brunobar79@gmail.com> | 2018-07-11 12:20:40 +0800 |
commit | 523cf9ad33d88719520ae5e7293329d133b64d4d (patch) | |
tree | d547846aa4938afbd90d242548f89f11200fe1b6 /app/scripts/metamask-controller.js | |
parent | b9c2994d24e688305d63aaefd7fac88d88773ad9 (diff) | |
download | tangerine-wallet-browser-523cf9ad33d88719520ae5e7293329d133b64d4d.tar tangerine-wallet-browser-523cf9ad33d88719520ae5e7293329d133b64d4d.tar.gz tangerine-wallet-browser-523cf9ad33d88719520ae5e7293329d133b64d4d.tar.bz2 tangerine-wallet-browser-523cf9ad33d88719520ae5e7293329d133b64d4d.tar.lz tangerine-wallet-browser-523cf9ad33d88719520ae5e7293329d133b64d4d.tar.xz tangerine-wallet-browser-523cf9ad33d88719520ae5e7293329d133b64d4d.tar.zst tangerine-wallet-browser-523cf9ad33d88719520ae5e7293329d133b64d4d.zip |
account removal is working
Diffstat (limited to 'app/scripts/metamask-controller.js')
-rw-r--r-- | app/scripts/metamask-controller.js | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js index bec02c3ed..e8f0eba90 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -354,6 +354,7 @@ module.exports = class MetamaskController extends EventEmitter { verifySeedPhrase: nodeify(this.verifySeedPhrase, this), clearSeedWordCache: this.clearSeedWordCache.bind(this), resetAccount: nodeify(this.resetAccount, this), + removeAccount: nodeify(this.removeAccount, this), importAccountWithStrategy: nodeify(this.importAccountWithStrategy, this), // trezor @@ -587,7 +588,8 @@ module.exports = class MetamaskController extends EventEmitter { } }) - this.preferencesController.setAccountLabel(trezorAccount, `TREZOR #${index + 1}`) + this.preferencesController.setAccountLabel(trezorAccount, `TREZOR #${parseInt(index, 10) + 1}`) + this.preferencesController.setSelectedAddress(trezorAccount) const { identities } = this.preferencesController.store.getState() return { ...keyState, identities } } @@ -706,6 +708,18 @@ module.exports = class MetamaskController extends EventEmitter { } /** + * Removes a "Loose" account from state. + * + * @param {string[]} address A hex address + * + */ + async removeAccount (address) { + this.preferencesController.removeAddress(address) + return address + } + + + /** * Imports an account with the specified import strategy. * These are defined in app/scripts/account-import-strategies * Each strategy represents a different way of serializing an Ethereum key pair. |