Skip to content

Commit

Permalink
Not implemented error with react native (#3666)
Browse files Browse the repository at this point in the history
* Not implemented error with react native

4161ec5#r40444884

* Update helpers.js

* Update helpers.js

* Update helpers.js

new URL(url) -> require('url').parse(url)

* Update helpers.js

* Update web3-shh.rst

another example bug

* Revert "Update web3-shh.rst"

This reverts commit 69f5045.

* Update CHANGELOG.md

* Update packages/web3-providers-ws/src/helpers.js

Co-authored-by: Wyatt Barnes <me@wyatt.email>

* detect ReactNative

Co-authored-by: Gregory Markou <16929357+GregTheGreek@users.noreply.github.com>
Co-authored-by: Frankie <frankie.diamond@gmail.com>
Co-authored-by: Wyatt Barnes <me@wyatt.email>
  • Loading branch information
4 people authored Sep 2, 2020
1 parent fb7db14 commit 67aa557
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -285,4 +285,5 @@ Released with 1.0.0-beta.37 code base.
### Fixed

- Fix parsing of non-`eth_subscription` provider events (#3660)
- Fix return value for `clearSubscriptions` (#3689)
- Fix parsedUrl problem of websocket provider (#3666)
- Fix return value for `clearSubscriptions` (#3689)
3 changes: 2 additions & 1 deletion packages/web3-providers-ws/src/helpers.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
var isNode = Object.prototype.toString.call(typeof process !== 'undefined' ? process : 0) === '[object process]';
var isRN = typeof navigator !== 'undefined' && navigator.product === 'ReactNative';

var _btoa = null;
var helpers = null;
if (isNode) {
if (isNode || isRN) {
_btoa = function(str) {
return Buffer.from(str).toString('base64');
};
Expand Down

0 comments on commit 67aa557

Please sign in to comment.