aboutsummaryrefslogtreecommitdiffstats
path: root/app/scripts/lib/config-manager.js
diff options
context:
space:
mode:
authorDan Finlay <dan@danfinlay.com>2016-05-21 07:18:54 +0800
committerDan Finlay <dan@danfinlay.com>2016-05-21 07:18:54 +0800
commit95a3cfe3fcffee2ffabd4cf71e568ae94693b10f (patch)
tree9c19992a823fb76a790cfdcbabb11ac1dc9b8fc1 /app/scripts/lib/config-manager.js
parent24fc5f9ea3a8cddfbf3993bdf0b18187a0787a64 (diff)
downloadtangerine-wallet-browser-95a3cfe3fcffee2ffabd4cf71e568ae94693b10f.tar
tangerine-wallet-browser-95a3cfe3fcffee2ffabd4cf71e568ae94693b10f.tar.gz
tangerine-wallet-browser-95a3cfe3fcffee2ffabd4cf71e568ae94693b10f.tar.bz2
tangerine-wallet-browser-95a3cfe3fcffee2ffabd4cf71e568ae94693b10f.tar.lz
tangerine-wallet-browser-95a3cfe3fcffee2ffabd4cf71e568ae94693b10f.tar.xz
tangerine-wallet-browser-95a3cfe3fcffee2ffabd4cf71e568ae94693b10f.tar.zst
tangerine-wallet-browser-95a3cfe3fcffee2ffabd4cf71e568ae94693b10f.zip
Added ability to nickname wallets locally
The changes are persisted to localstorage, so they cannot be restored on a new computer, but for right now it's a nice organizational feature.
Diffstat (limited to 'app/scripts/lib/config-manager.js')
-rw-r--r--app/scripts/lib/config-manager.js20
1 files changed, 20 insertions, 0 deletions
diff --git a/app/scripts/lib/config-manager.js b/app/scripts/lib/config-manager.js
index 7b2f2f1f8..f5e1cf38d 100644
--- a/app/scripts/lib/config-manager.js
+++ b/app/scripts/lib/config-manager.js
@@ -230,6 +230,26 @@ ConfigManager.prototype.updateTx = function(tx) {
this._saveTxList(transactions)
}
+// wallet nickname methods
+
+ConfigManager.prototype.getWalletNicknames = function() {
+ var data = this.getData()
+ let nicknames = ('walletNicknames' in data) ? data.walletNicknames : {}
+ return nicknames
+}
+
+ConfigManager.prototype.nicknameForWallet = function(account) {
+ let nicknames = this.getWalletNicknames()
+ return nicknames[account]
+}
+
+ConfigManager.prototype.setNicknameForWallet = function(account, nickname) {
+ let nicknames = this.getWalletNicknames()
+ nicknames[account] = nickname
+ var data = this.getData()
+ data.walletNicknames = nicknames
+ this.setData(data)
+}
// observable