aboutsummaryrefslogtreecommitdiffstats
path: root/app/scripts/lib/idStore.js
diff options
context:
space:
mode:
authorkumavis <kumavis@users.noreply.github.com>2016-05-21 07:54:00 +0800
committerkumavis <kumavis@users.noreply.github.com>2016-05-21 07:54:00 +0800
commit27790b38a95e219b7663852150b82387cedb58e2 (patch)
tree4c71d9f923b5119f12bea5865c921789303699cf /app/scripts/lib/idStore.js
parentda6e965b66434f4ca0151c4e40ba88a3865814ef (diff)
parent8efd30ad7af4350108dc418571e16e74aa069375 (diff)
downloadtangerine-wallet-browser-27790b38a95e219b7663852150b82387cedb58e2.tar
tangerine-wallet-browser-27790b38a95e219b7663852150b82387cedb58e2.tar.gz
tangerine-wallet-browser-27790b38a95e219b7663852150b82387cedb58e2.tar.bz2
tangerine-wallet-browser-27790b38a95e219b7663852150b82387cedb58e2.tar.lz
tangerine-wallet-browser-27790b38a95e219b7663852150b82387cedb58e2.tar.xz
tangerine-wallet-browser-27790b38a95e219b7663852150b82387cedb58e2.tar.zst
tangerine-wallet-browser-27790b38a95e219b7663852150b82387cedb58e2.zip
Merge pull request #201 from MetaMask/AccountCrud
Add ability to nickname accounts
Diffstat (limited to 'app/scripts/lib/idStore.js')
-rw-r--r--app/scripts/lib/idStore.js12
1 files changed, 10 insertions, 2 deletions
diff --git a/app/scripts/lib/idStore.js b/app/scripts/lib/idStore.js
index 0604c4bca..9d2552e8b 100644
--- a/app/scripts/lib/idStore.js
+++ b/app/scripts/lib/idStore.js
@@ -325,9 +325,10 @@ IdentityStore.prototype._loadIdentities = function(){
// // add to ethStore
this._ethStore.addAccount(address)
// add to identities
+ const defaultLabel = 'Wallet ' + (i+1)
+ const nickname = configManager.nicknameForWallet(address)
var identity = {
- name: 'Wallet ' + (i+1),
- img: 'QmW6hcwYzXrNkuHrpvo58YeZvbZxUddv69ATSHY3BHpPdd',
+ name: nickname || defaultLabel,
address: address,
mayBeFauceting: this._mayBeFauceting(i),
}
@@ -336,6 +337,13 @@ IdentityStore.prototype._loadIdentities = function(){
this._didUpdate()
}
+IdentityStore.prototype.saveAccountLabel = function(account, label, cb) {
+ configManager.setNicknameForWallet(account, label)
+ this._loadIdentities()
+ cb(null, label)
+ this._didUpdate()
+}
+
// mayBeFauceting
// If on testnet, index 0 may be fauceting.
// The UI will have to check the balance to know.