stream-chat-react-native 3.10.2 → 4.0.0-beta.1
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.
- package/package.json +2 -3
- package/src/index.js +5 -7
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "stream-chat-react-native",
|
|
3
3
|
"description": "The official React Native SDK for Stream Chat, a service for building chat applications",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "4.0.0-beta.1",
|
|
5
5
|
"author": {
|
|
6
6
|
"company": "Stream.io Inc",
|
|
7
7
|
"name": "Stream.io Inc"
|
|
@@ -11,10 +11,9 @@
|
|
|
11
11
|
"types": "types/index.d.ts",
|
|
12
12
|
"dependencies": {
|
|
13
13
|
"es6-symbol": "^3.1.3",
|
|
14
|
-
"stream-chat-react-native-core": "
|
|
14
|
+
"stream-chat-react-native-core": "4.0.0-beta.1"
|
|
15
15
|
},
|
|
16
16
|
"peerDependencies": {
|
|
17
|
-
"@react-native-community/blur": ">=3.6.0",
|
|
18
17
|
"@react-native-community/cameraroll": ">=4.0.1",
|
|
19
18
|
"@react-native-community/netinfo": ">=2.0.7",
|
|
20
19
|
"react-native": ">=0.60.0",
|
package/src/index.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { PermissionsAndroid, Platform } from 'react-native';
|
|
3
|
-
import { BlurView as RNBlurView } from '@react-native-community/blur';
|
|
4
3
|
import CameraRoll from '@react-native-community/cameraroll';
|
|
5
4
|
import NetInfo from '@react-native-community/netinfo';
|
|
6
5
|
import { FlatList } from '@stream-io/flat-list-mvcp';
|
|
@@ -13,10 +12,6 @@ import RNShare from 'react-native-share';
|
|
|
13
12
|
import { registerNativeHandlers } from 'stream-chat-react-native-core';
|
|
14
13
|
|
|
15
14
|
registerNativeHandlers({
|
|
16
|
-
// eslint-disable-next-line react/display-name
|
|
17
|
-
BlurView: ({ blurAmount = 10, blurType = 'dark', style }) => (
|
|
18
|
-
<RNBlurView blurAmount={blurAmount} blurType={blurType} style={style} />
|
|
19
|
-
),
|
|
20
15
|
compressImage: async ({ compressImageQuality = 1, height, uri, width }) => {
|
|
21
16
|
try {
|
|
22
17
|
const { uri: compressedUri } = await ImageResizer.createResizedImage(
|
|
@@ -95,8 +90,11 @@ registerNativeHandlers({
|
|
|
95
90
|
let unsubscribe;
|
|
96
91
|
// For NetInfo >= 3.x.x
|
|
97
92
|
if (NetInfo.fetch && typeof NetInfo.fetch === 'function') {
|
|
98
|
-
unsubscribe = NetInfo.addEventListener(({ isConnected }) => {
|
|
99
|
-
|
|
93
|
+
unsubscribe = NetInfo.addEventListener(({ isConnected, isInternetReachable }) => {
|
|
94
|
+
// Initialize with truthy value when internetReachable is still loading
|
|
95
|
+
// if it resolves to false, listener is triggered with false value and network
|
|
96
|
+
// status is updated
|
|
97
|
+
listener(isInternetReachable === null ? isConnected : isConnected && isInternetReachable);
|
|
100
98
|
});
|
|
101
99
|
return unsubscribe;
|
|
102
100
|
} else {
|