fix hardware wallets account name

This commit is contained in:
brunobar79 2018-08-21 00:04:30 -04:00
parent 34e3ec6092
commit cee5783283
1 changed files with 3 additions and 1 deletions

View File

@ -668,7 +668,9 @@ module.exports = class MetamaskController extends EventEmitter {
this.preferencesController.setAddresses(newAccounts)
newAccounts.forEach(address => {
if (!oldAccounts.includes(address)) {
this.preferencesController.setAccountLabel(address, `${deviceName.toUpperCase()} ${parseInt(index, 10) + 1}`)
// Set the account label to Trezor 1 / Ledger 1, etc
this.preferencesController.setAccountLabel(address, `${deviceName[0].toUpperCase()}${deviceName.slice(1)} ${parseInt(index, 10) + 1}`)
// Select the account
this.preferencesController.setSelectedAddress(address)
}
})