diff options
author | frankiebee <frankie.diamond@gmail.com> | 2017-09-07 04:45:03 +0800 |
---|---|---|
committer | frankiebee <frankie.diamond@gmail.com> | 2017-09-07 04:45:03 +0800 |
commit | 6c83ba762e73419c6db444dde05b3ebe31d7028e (patch) | |
tree | 0a1655190af8d8076de514452a70a8b54d27d371 /app/scripts/lib/inpage-provider.js | |
parent | 15c12ca4bb6996f43518630ded12c0d7be2d571b (diff) | |
parent | 47340ca550cf8bc6738a6970e10b599416da3a39 (diff) | |
download | tangerine-wallet-browser-6c83ba762e73419c6db444dde05b3ebe31d7028e.tar tangerine-wallet-browser-6c83ba762e73419c6db444dde05b3ebe31d7028e.tar.gz tangerine-wallet-browser-6c83ba762e73419c6db444dde05b3ebe31d7028e.tar.bz2 tangerine-wallet-browser-6c83ba762e73419c6db444dde05b3ebe31d7028e.tar.lz tangerine-wallet-browser-6c83ba762e73419c6db444dde05b3ebe31d7028e.tar.xz tangerine-wallet-browser-6c83ba762e73419c6db444dde05b3ebe31d7028e.tar.zst tangerine-wallet-browser-6c83ba762e73419c6db444dde05b3ebe31d7028e.zip |
Merge branch 'master' into transactionControllerRefractorPt3
Diffstat (limited to 'app/scripts/lib/inpage-provider.js')
-rw-r--r-- | app/scripts/lib/inpage-provider.js | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/app/scripts/lib/inpage-provider.js b/app/scripts/lib/inpage-provider.js index fd032a673..c63af06dc 100644 --- a/app/scripts/lib/inpage-provider.js +++ b/app/scripts/lib/inpage-provider.js @@ -27,7 +27,7 @@ function MetamaskInpageProvider (connectionStream) { ) // ignore phishing warning message (handled elsewhere) - multiStream.ignoreStream('phishing') + multiStream.ignoreStream('phishing') // connect to async provider const asyncProvider = self.asyncProvider = new StreamProvider() @@ -43,8 +43,9 @@ function MetamaskInpageProvider (connectionStream) { // handle sendAsync requests via asyncProvider self.sendAsync = function (payload, cb) { // rewrite request ids - var request = eachJsonMessage(payload, (message) => { - var newId = createRandomId() + var request = eachJsonMessage(payload, (_message) => { + const message = Object.assign({}, _message) + const newId = createRandomId() self.idMap[newId] = message.id message.id = newId return message @@ -80,7 +81,7 @@ MetamaskInpageProvider.prototype.send = function (payload) { case 'eth_coinbase': // read from localStorage selectedAddress = self.publicConfigStore.getState().selectedAddress - result = selectedAddress + result = selectedAddress || null break case 'eth_uninstallFilter': @@ -90,7 +91,7 @@ MetamaskInpageProvider.prototype.send = function (payload) { case 'net_version': const networkVersion = self.publicConfigStore.getState().networkVersion - result = networkVersion + result = networkVersion || null break // throw not-supported Error |