1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 09:52:26 +01:00

fix hardware wallets account name

This commit is contained in:
brunobar79 2018-08-21 00:04:30 -04:00
parent 34e3ec6092
commit cee5783283

View File

@ -668,7 +668,9 @@ module.exports = class MetamaskController extends EventEmitter {
this.preferencesController.setAddresses(newAccounts) this.preferencesController.setAddresses(newAccounts)
newAccounts.forEach(address => { newAccounts.forEach(address => {
if (!oldAccounts.includes(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) this.preferencesController.setSelectedAddress(address)
} }
}) })