aboutsummaryrefslogtreecommitdiffstats
path: root/app
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 /app
parent2de3039b6b21ca05ef185c078b67815448864c72 (diff)
downloadtangerine-wallet-browser-d3f793a44a94274c73e0ce770f34bb2e22cdbd5b.tar
tangerine-wallet-browser-d3f793a44a94274c73e0ce770f34bb2e22cdbd5b.tar.gz
tangerine-wallet-browser-d3f793a44a94274c73e0ce770f34bb2e22cdbd5b.tar.bz2
tangerine-wallet-browser-d3f793a44a94274c73e0ce770f34bb2e22cdbd5b.tar.lz
tangerine-wallet-browser-d3f793a44a94274c73e0ce770f34bb2e22cdbd5b.tar.xz
tangerine-wallet-browser-d3f793a44a94274c73e0ce770f34bb2e22cdbd5b.tar.zst
tangerine-wallet-browser-d3f793a44a94274c73e0ce770f34bb2e22cdbd5b.zip
added label for trezor accounts
Diffstat (limited to 'app')
-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 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 }
}