diff options
author | kumavis <kumavis@users.noreply.github.com> | 2016-10-13 04:52:32 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-10-13 04:52:32 +0800 |
commit | 8d5b2478e3aa939cb4b0a58b20b199cded62769e (patch) | |
tree | b287ae4a264fd29f5ec8b5fe2c97564fb80f62f8 /app/scripts/lib/inpage-provider.js | |
parent | f68673e84ac48c5574b642b3b779d4d43954d98f (diff) | |
parent | 465cff78c33385c7f108e7539f484119f7a03767 (diff) | |
download | tangerine-wallet-browser-8d5b2478e3aa939cb4b0a58b20b199cded62769e.tar tangerine-wallet-browser-8d5b2478e3aa939cb4b0a58b20b199cded62769e.tar.gz tangerine-wallet-browser-8d5b2478e3aa939cb4b0a58b20b199cded62769e.tar.bz2 tangerine-wallet-browser-8d5b2478e3aa939cb4b0a58b20b199cded62769e.tar.lz tangerine-wallet-browser-8d5b2478e3aa939cb4b0a58b20b199cded62769e.tar.xz tangerine-wallet-browser-8d5b2478e3aa939cb4b0a58b20b199cded62769e.tar.zst tangerine-wallet-browser-8d5b2478e3aa939cb4b0a58b20b199cded62769e.zip |
Merge pull request #730 from MetaMask/i695-dapp-reload
dapp reload - fixed disconnect detection via polling
Diffstat (limited to 'app/scripts/lib/inpage-provider.js')
-rw-r--r-- | app/scripts/lib/inpage-provider.js | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/app/scripts/lib/inpage-provider.js b/app/scripts/lib/inpage-provider.js index bcde333d0..c6bfdb4da 100644 --- a/app/scripts/lib/inpage-provider.js +++ b/app/scripts/lib/inpage-provider.js @@ -1,6 +1,6 @@ const Streams = require('mississippi') -const ObjectMultiplex = require('./obj-multiplex') const StreamProvider = require('web3-stream-provider') +const ObjectMultiplex = require('./obj-multiplex') const RemoteStore = require('./remote-store.js').RemoteStore module.exports = MetamaskInpageProvider @@ -11,8 +11,9 @@ function MetamaskInpageProvider (connectionStream) { // setup connectionStream multiplexing var multiStream = ObjectMultiplex() Streams.pipe(connectionStream, multiStream, connectionStream, function (err) { - console.warn('MetamaskInpageProvider - lost connection to MetaMask') - if (err) throw err + let warningMsg = 'MetamaskInpageProvider - lost connection to MetaMask' + if (err) warningMsg += '\n' + err.stack + console.warn(warningMsg) }) self.multiStream = multiStream @@ -20,16 +21,18 @@ function MetamaskInpageProvider (connectionStream) { var publicConfigStore = remoteStoreWithLocalStorageCache('MetaMask-Config') var storeStream = publicConfigStore.createStream() Streams.pipe(storeStream, multiStream.createStream('publicConfig'), storeStream, function (err) { - console.warn('MetamaskInpageProvider - lost connection to MetaMask publicConfig') - if (err) throw err + let warningMsg = 'MetamaskInpageProvider - lost connection to MetaMask publicConfig' + if (err) warningMsg += '\n' + err.stack + console.warn(warningMsg) }) self.publicConfigStore = publicConfigStore // connect to async provider var asyncProvider = new StreamProvider() Streams.pipe(asyncProvider, multiStream.createStream('provider'), asyncProvider, function (err) { - console.warn('MetamaskInpageProvider - lost connection to MetaMask provider') - if (err) throw err + let warningMsg = 'MetamaskInpageProvider - lost connection to MetaMask provider' + if (err) warningMsg += '\n' + err.stack + console.warn(warningMsg) }) asyncProvider.on('error', console.error.bind(console)) self.asyncProvider = asyncProvider |