@walletconnect/react-native-compat 2.9.1-canary.0 → 2.9.1-canary.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. package/index.js +3 -9
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -27,17 +27,11 @@ if (typeof global?.Platform === "undefined") {
27
27
  }
28
28
  }
29
29
 
30
- if (typeof global?.isOnline === "undefined") {
30
+ if (typeof global?.NetInfo === "undefined") {
31
31
  try {
32
- require("react-native").NetInfo.addEventListener((state) => {
33
- // eslint-disable-next-line no-console
34
- console.log("Connection type", state.type);
35
- // eslint-disable-next-line no-console
36
- console.log("Is connected?", state.isConnected);
37
- global.isOnline = state.isConnected;
38
- });
32
+ global.NetInfo = require("@react-native-community/netinfo");
39
33
  } catch (e) {
40
34
  // eslint-disable-next-line no-console
41
- console.error("react-native-compat: react-native.NetInfo is not available");
35
+ console.error("react-native-compat: react-native.NetInfo is not available", e);
42
36
  }
43
37
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@walletconnect/react-native-compat",
3
3
  "description": "Shims for WalletConnect Protocol in React Native Projects",
4
- "version": "2.9.1-canary.0",
4
+ "version": "2.9.1-canary.1",
5
5
  "author": "WalletConnect, Inc. <walletconnect.com>",
6
6
  "homepage": "https://github.com/walletconnect/walletconnect-monorepo/",
7
7
  "license": "Apache-2.0",