aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbrunobar79 <brunobar79@gmail.com>2018-07-10 07:04:30 +0800
committerbrunobar79 <brunobar79@gmail.com>2018-07-10 07:04:30 +0800
commitd3f793a44a94274c73e0ce770f34bb2e22cdbd5b (patch)
treed11ca8d1d762035868af79508ac6256f86578f29
parent2de3039b6b21ca05ef185c078b67815448864c72 (diff)
downloaddexon-wallet-d3f793a44a94274c73e0ce770f34bb2e22cdbd5b.tar.gz
dexon-wallet-d3f793a44a94274c73e0ce770f34bb2e22cdbd5b.tar.zst
dexon-wallet-d3f793a44a94274c73e0ce770f34bb2e22cdbd5b.zip
added label for trezor accounts
-rw-r--r--app/scripts/metamask-controller.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js
index 08b75e83..71a22f6e 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 }
}