From d3f793a44a94274c73e0ce770f34bb2e22cdbd5b Mon Sep 17 00:00:00 2001 From: brunobar79 Date: Mon, 9 Jul 2018 19:04:30 -0400 Subject: [PATCH] added label for trezor accounts --- app/scripts/metamask-controller.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js index 08b75e839..71a22f6ec 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -578,7 +578,8 @@ module.exports = class MetamaskController extends EventEmitter { const oldAccounts = await keyringController.getAccounts() const keyState = await keyringController.addNewAccount(keyring) const newAccounts = await keyringController.getAccounts() - + // Assuming the trezor account is the last one + const trezorAccount = newAccounts[newAccounts.length -1] this.preferencesController.setAddresses(newAccounts) newAccounts.forEach(address => { if (!oldAccounts.includes(address)) { @@ -586,6 +587,7 @@ module.exports = class MetamaskController extends EventEmitter { } }) + this.preferencesController.setAccountLabel(trezorAccount, `TREZOR #${index + 1}`) const { identities } = this.preferencesController.store.getState() return { ...keyState, identities } }