diff options
author | Kevin Serrano <kevgagser@gmail.com> | 2017-02-09 07:51:22 +0800 |
---|---|---|
committer | Kevin Serrano <kevgagser@gmail.com> | 2017-02-09 07:51:22 +0800 |
commit | 4033b620bd415421a5681cd9a6cd2c7e5ef8ff66 (patch) | |
tree | 92f5e44c923ee3f1caea2db9fa647223deb19a7c /app/scripts | |
parent | ce57957aa0fdeb79efd6ede8b6e94b8f26131dcf (diff) | |
download | tangerine-wallet-browser-4033b620bd415421a5681cd9a6cd2c7e5ef8ff66.tar tangerine-wallet-browser-4033b620bd415421a5681cd9a6cd2c7e5ef8ff66.tar.gz tangerine-wallet-browser-4033b620bd415421a5681cd9a6cd2c7e5ef8ff66.tar.bz2 tangerine-wallet-browser-4033b620bd415421a5681cd9a6cd2c7e5ef8ff66.tar.lz tangerine-wallet-browser-4033b620bd415421a5681cd9a6cd2c7e5ef8ff66.tar.xz tangerine-wallet-browser-4033b620bd415421a5681cd9a6cd2c7e5ef8ff66.tar.zst tangerine-wallet-browser-4033b620bd415421a5681cd9a6cd2c7e5ef8ff66.zip |
Allowed net_version to be called synchronously
Diffstat (limited to 'app/scripts')
-rw-r--r-- | app/scripts/lib/inpage-provider.js | 5 | ||||
-rw-r--r-- | app/scripts/metamask-controller.js | 3 |
2 files changed, 7 insertions, 1 deletions
diff --git a/app/scripts/lib/inpage-provider.js b/app/scripts/lib/inpage-provider.js index faecac137..92936de2f 100644 --- a/app/scripts/lib/inpage-provider.js +++ b/app/scripts/lib/inpage-provider.js @@ -84,6 +84,11 @@ MetamaskInpageProvider.prototype.send = function (payload) { result = true break + case 'net_version': + let networkVersion = self.publicConfigStore.getState().networkVersion + result = networkVersion + break + // throw not-supported Error default: var link = 'https://github.com/MetaMask/faq/blob/master/DEVELOPERS.md#dizzy-all-async---think-of-metamask-as-a-light-client' diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js index fb2040c63..33c51dc07 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -178,7 +178,7 @@ module.exports = class MetamaskController extends EventEmitter { // sync publicConfigStore with transform pipe( this.store, - storeTransform(selectPublicState), + storeTransform(selectPublicState.bind(this)), publicConfigStore ) @@ -186,6 +186,7 @@ module.exports = class MetamaskController extends EventEmitter { const result = { selectedAddress: undefined } try { result.selectedAddress = state.PreferencesController.selectedAddress + result.networkVersion = this.getNetworkState() } catch (_) {} return result } |