Skip to content
This repository was archived by the owner on Mar 5, 2025. It is now read-only.

Not implemented error with react native #3666

Merged
merged 24 commits into from
Sep 2, 2020
Merged
Show file tree
Hide file tree
Changes from 23 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like the correct way to check if running ReactNative


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