diff options
author | frankiebee <frankie.diamond@gmail.com> | 2017-04-03 14:04:55 +0800 |
---|---|---|
committer | frankiebee <frankie.diamond@gmail.com> | 2017-04-03 14:04:55 +0800 |
commit | f81fdbc34ff037ab64a9f4c98100304e7b1132e4 (patch) | |
tree | 20f2a75068af1b4b13ecb9a9b6276e07af94de93 /app/scripts/metamask-controller.js | |
parent | 89c924101e3ff52849c5a82ced7e058e1fa39dfd (diff) | |
parent | 235a70b9392d8b87eae4fc141e7f0be1d7788ee2 (diff) | |
download | tangerine-wallet-browser-f81fdbc34ff037ab64a9f4c98100304e7b1132e4.tar tangerine-wallet-browser-f81fdbc34ff037ab64a9f4c98100304e7b1132e4.tar.gz tangerine-wallet-browser-f81fdbc34ff037ab64a9f4c98100304e7b1132e4.tar.bz2 tangerine-wallet-browser-f81fdbc34ff037ab64a9f4c98100304e7b1132e4.tar.lz tangerine-wallet-browser-f81fdbc34ff037ab64a9f4c98100304e7b1132e4.tar.xz tangerine-wallet-browser-f81fdbc34ff037ab64a9f4c98100304e7b1132e4.tar.zst tangerine-wallet-browser-f81fdbc34ff037ab64a9f4c98100304e7b1132e4.zip |
Merge branch 'master' into mascara
Diffstat (limited to 'app/scripts/metamask-controller.js')
-rw-r--r-- | app/scripts/metamask-controller.js | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js index db80d5f1b..d360e7d95 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -20,7 +20,6 @@ const MessageManager = require('./lib/message-manager') const PersonalMessageManager = require('./lib/personal-message-manager') const TxManager = require('./transaction-manager') const ConfigManager = require('./lib/config-manager') -const extension = require('./lib/extension') const autoFaucet = require('./lib/auto-faucet') const nodeify = require('./lib/nodeify') const accountImporter = require('./account-import-strategies') @@ -34,6 +33,9 @@ module.exports = class MetamaskController extends EventEmitter { this.opts = opts let initState = opts.initState || {} + // platform-specific api + this.platform = opts.platform + // observable state store this.store = new ObservableStore(initState) @@ -629,7 +631,7 @@ module.exports = class MetamaskController extends EventEmitter { break } - if (url) extension.tabs.create({ url }) + if (url) this.platform.openWindow({ url }) } createShapeShiftTx (depositAddress, depositType) { @@ -647,7 +649,7 @@ module.exports = class MetamaskController extends EventEmitter { setDefaultRpc () { this.configManager.setRpcTarget('http://localhost:8545') - extension.runtime.reload() + this.platform.reload() this.lookupNetwork() return Promise.resolve('http://localhost:8545') } @@ -656,7 +658,7 @@ module.exports = class MetamaskController extends EventEmitter { this.configManager.setRpcTarget(rpcTarget) return this.preferencesController.updateFrequentRpcList(rpcTarget) .then(() => { - extension.runtime.reload() + this.platform.reload() this.lookupNetwork() return Promise.resolve(rpcTarget) }) @@ -664,13 +666,13 @@ module.exports = class MetamaskController extends EventEmitter { setProviderType (type) { this.configManager.setProviderType(type) - extension.runtime.reload() + this.platform.reload() this.lookupNetwork() } useEtherscanProvider () { this.configManager.useEtherscanProvider() - extension.runtime.reload() + this.platform.reload() } getNetworkState () { |