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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.js +15 -0
  2. package/package.json +2 -1
package/index.js CHANGED
@@ -26,3 +26,18 @@ if (typeof global?.Platform === "undefined") {
26
26
  console.error("react-native-compat: react-native.Platform is not available");
27
27
  }
28
28
  }
29
+
30
+ if (typeof global?.isOnline === "undefined") {
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
+ });
39
+ } catch (e) {
40
+ // eslint-disable-next-line no-console
41
+ console.error("react-native-compat: react-native.NetInfo is not available");
42
+ }
43
+ }
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.0-e9ace057",
4
+ "version": "2.9.1-canary.0",
5
5
  "author": "WalletConnect, Inc. <walletconnect.com>",
6
6
  "homepage": "https://github.com/walletconnect/walletconnect-monorepo/",
7
7
  "license": "Apache-2.0",
@@ -21,6 +21,7 @@
21
21
  "prettier": "prettier --check './**/*.{js,ts,jsx,tsx}'"
22
22
  },
23
23
  "dependencies": {
24
+ "@react-native-community/netinfo": "^9.4.1",
24
25
  "events": "3.3.0",
25
26
  "fast-text-encoding": "^1.0.6"
26
27
  },