Skip to content

Commit

Permalink
Merge pull request #1 from NomismaTech/jack/metamask-7.7-fix
Browse files Browse the repository at this point in the history
temporary fix for batchRequest
  • Loading branch information
hxc20060903 authored Dec 4, 2019
2 parents 8a3b5a7 + bf9d2e0 commit b034f26
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/web3-providers/src/providers/MetamaskProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,10 @@ export default class MetamaskProvider extends AbstractSocketProvider {
* @returns {Promise<any>}
*/
sendPayload(payload) {
// array for BatchRequest
const method = Array.isArray(payload) ? 'sendAsync' : 'send';
return new Promise((resolve, reject) => {
this.connection.send(payload, (error, response) => {
this.connection[method](payload, (error, response) => {
if (!error) {
return resolve(response);
}
Expand Down

0 comments on commit b034f26

Please sign in to comment.