diff options
author | Kevin Serrano <kevgagser@gmail.com> | 2016-11-01 02:35:09 +0800 |
---|---|---|
committer | Kevin Serrano <kevgagser@gmail.com> | 2016-11-01 02:35:09 +0800 |
commit | 96643c222a74552d98218fe1f9fc81e493a1960f (patch) | |
tree | 9e49503ee49ca0bce8c888c286719de5eb27f1e6 /app/scripts/lib/config-manager.js | |
parent | 6fc498f8a030ea00bcef9b8b3400fc527fc4aeed (diff) | |
download | tangerine-wallet-browser-96643c222a74552d98218fe1f9fc81e493a1960f.tar tangerine-wallet-browser-96643c222a74552d98218fe1f9fc81e493a1960f.tar.gz tangerine-wallet-browser-96643c222a74552d98218fe1f9fc81e493a1960f.tar.bz2 tangerine-wallet-browser-96643c222a74552d98218fe1f9fc81e493a1960f.tar.lz tangerine-wallet-browser-96643c222a74552d98218fe1f9fc81e493a1960f.tar.xz tangerine-wallet-browser-96643c222a74552d98218fe1f9fc81e493a1960f.tar.zst tangerine-wallet-browser-96643c222a74552d98218fe1f9fc81e493a1960f.zip |
Implement seed word confirmation page.
Remove logs.
Move HD render files to ui/app.
Diffstat (limited to 'app/scripts/lib/config-manager.js')
-rw-r--r-- | app/scripts/lib/config-manager.js | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/app/scripts/lib/config-manager.js b/app/scripts/lib/config-manager.js index abe5dfc87..8f5590738 100644 --- a/app/scripts/lib/config-manager.js +++ b/app/scripts/lib/config-manager.js @@ -2,6 +2,7 @@ const Migrator = require('pojo-migrator') const MetamaskConfig = require('../config.js') const migrations = require('./migrations') const rp = require('request-promise') +const ethUtil = require('ethereumjs-util') const TESTNET_RPC = MetamaskConfig.network.testnet const MAINNET_RPC = MetamaskConfig.network.mainnet @@ -138,7 +139,7 @@ ConfigManager.prototype.getSelectedAccount = function () { ConfigManager.prototype.setSelectedAccount = function (address) { var config = this.getConfig() - config.selectedAccount = address + config.selectedAccount = ethUtil.addHexPrefix(address) this.setConfig(config) } @@ -153,11 +154,23 @@ ConfigManager.prototype.setShowSeedWords = function (should) { this.setData(data) } + ConfigManager.prototype.getShouldShowSeedWords = function () { var data = this.migrator.getData() return data.showSeedWords } +ConfigManager.prototype.setSeedWords = function (words) { + var data = this.getData() + data.seedWords = words + this.setData(data) +} + +ConfigManager.prototype.getSeedWords = function () { + var data = this.getData() + return ('seedWords' in data) && data.seedWords +} + ConfigManager.prototype.getCurrentRpcAddress = function () { var provider = this.getProvider() if (!provider) return null |