aboutsummaryrefslogtreecommitdiffstats
path: root/app/scripts/lib/config-manager.js
diff options
context:
space:
mode:
authorDan Finlay <somniac@me.com>2016-05-24 05:43:17 +0800
committerDan Finlay <somniac@me.com>2016-05-24 05:43:17 +0800
commit0c73e583727e8cd67df7ad119e8d453306fa5c5d (patch)
tree350ed72bc2cc609bc6fd2e638cda3ad03b7d3e61 /app/scripts/lib/config-manager.js
parent7f77fe1a790fbd466b91f5a8f6bf25fbd0982ae4 (diff)
parenta439e04ed4fae2bbf4da6cfca2a516991aa89178 (diff)
downloadtangerine-wallet-browser-0c73e583727e8cd67df7ad119e8d453306fa5c5d.tar
tangerine-wallet-browser-0c73e583727e8cd67df7ad119e8d453306fa5c5d.tar.gz
tangerine-wallet-browser-0c73e583727e8cd67df7ad119e8d453306fa5c5d.tar.bz2
tangerine-wallet-browser-0c73e583727e8cd67df7ad119e8d453306fa5c5d.tar.lz
tangerine-wallet-browser-0c73e583727e8cd67df7ad119e8d453306fa5c5d.tar.xz
tangerine-wallet-browser-0c73e583727e8cd67df7ad119e8d453306fa5c5d.tar.zst
tangerine-wallet-browser-0c73e583727e8cd67df7ad119e8d453306fa5c5d.zip
Merge pull request #204 from MetaMask/dev
Merge UI redesign into master
Diffstat (limited to 'app/scripts/lib/config-manager.js')
-rw-r--r--app/scripts/lib/config-manager.js27
1 files changed, 24 insertions, 3 deletions
diff --git a/app/scripts/lib/config-manager.js b/app/scripts/lib/config-manager.js
index 3c9326db9..f5e1cf38d 100644
--- a/app/scripts/lib/config-manager.js
+++ b/app/scripts/lib/config-manager.js
@@ -1,11 +1,12 @@
const Migrator = require('pojo-migrator')
const extend = require('xtend')
+const MetamaskConfig = require('../config.js')
+const migrations = require('./migrations')
const STORAGE_KEY = 'metamask-config'
-const TESTNET_RPC = 'https://morden.infura.io'
-const MAINNET_RPC = 'https://mainnet.infura.io/'
+const TESTNET_RPC = MetamaskConfig.network.testnet
+const MAINNET_RPC = MetamaskConfig.network.mainnet
-const migrations = require('./migrations')
/* The config-manager is a convenience object
* wrapping a pojo-migrator.
@@ -229,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