stream-chat-expo 4.5.1-beta.1 → 4.6.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 -2
- package/src/index.js +13 -8
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "stream-chat-expo",
|
|
3
3
|
"description": "The official Expo SDK for Stream Chat, a service for building chat applications",
|
|
4
|
-
"version": "4.
|
|
4
|
+
"version": "4.6.0-beta.1",
|
|
5
5
|
"author": {
|
|
6
6
|
"company": "Stream.io Inc",
|
|
7
7
|
"name": "Stream.io Inc"
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"main": "src/index.js",
|
|
11
11
|
"types": "types/index.d.ts",
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"stream-chat-react-native-core": "4.
|
|
13
|
+
"stream-chat-react-native-core": "4.6.0-beta.1"
|
|
14
14
|
},
|
|
15
15
|
"peerDependencies": {
|
|
16
16
|
"@react-native-community/netinfo": "^6.0.0",
|
package/src/index.js
CHANGED
|
@@ -45,15 +45,19 @@ registerNativeHandlers({
|
|
|
45
45
|
const results = await MediaLibrary.getAssetsAsync({
|
|
46
46
|
after,
|
|
47
47
|
first,
|
|
48
|
-
mediaType: [MediaLibrary.MediaType.photo],
|
|
48
|
+
mediaType: [MediaLibrary.MediaType.photo, MediaLibrary.MediaType.video],
|
|
49
49
|
});
|
|
50
50
|
const assets = results.assets.map((asset) => ({
|
|
51
|
+
duration: asset.duration,
|
|
52
|
+
filename: asset.filename,
|
|
51
53
|
height: asset.height,
|
|
52
54
|
id: asset.id,
|
|
53
55
|
source: 'picker',
|
|
56
|
+
type: asset.mediaType,
|
|
54
57
|
uri: asset.uri,
|
|
55
58
|
width: asset.width,
|
|
56
59
|
}));
|
|
60
|
+
|
|
57
61
|
const hasNextPage = results.hasNextPage;
|
|
58
62
|
const endCursor = results.endCursor;
|
|
59
63
|
return { assets, endCursor, hasNextPage };
|
|
@@ -155,12 +159,13 @@ registerNativeHandlers({
|
|
|
155
159
|
// https://github.com/ivpusic/react-native-image-crop-picker/issues/901
|
|
156
160
|
// This we can't rely on them as it is, and we need to use Image.getSize
|
|
157
161
|
// to get accurate size.
|
|
158
|
-
const getSize = () =>
|
|
159
|
-
|
|
160
|
-
|
|
162
|
+
const getSize = () =>
|
|
163
|
+
new Promise((resolve) => {
|
|
164
|
+
Image.getSize(photo.uri, (width, height) => {
|
|
165
|
+
resolve({ height, width });
|
|
166
|
+
});
|
|
161
167
|
});
|
|
162
|
-
|
|
163
|
-
|
|
168
|
+
|
|
164
169
|
try {
|
|
165
170
|
const { height, width } = await getSize();
|
|
166
171
|
size.height = height;
|
|
@@ -175,12 +180,12 @@ registerNativeHandlers({
|
|
|
175
180
|
width: photo.width,
|
|
176
181
|
};
|
|
177
182
|
}
|
|
178
|
-
|
|
183
|
+
|
|
179
184
|
return {
|
|
180
185
|
cancelled: false,
|
|
181
186
|
source: 'camera',
|
|
182
187
|
uri: photo.uri,
|
|
183
|
-
...size
|
|
188
|
+
...size,
|
|
184
189
|
};
|
|
185
190
|
}
|
|
186
191
|
}
|