stream-chat-expo 5.16.0-beta.1 → 5.16.0-beta.2

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 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": "5.16.0-beta.1",
4
+ "version": "5.16.0-beta.2",
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": "5.16.0-beta.1"
13
+ "stream-chat-react-native-core": "5.16.0-beta.2"
14
14
  },
15
15
  "peerDependencies": {
16
16
  "@react-native-community/netinfo": ">=6.0.0",
@@ -15,15 +15,37 @@ if (!DocumentPicker) {
15
15
  export const pickDocument = DocumentPicker
16
16
  ? async () => {
17
17
  try {
18
- const { type, ...rest } = await DocumentPicker.getDocumentAsync();
18
+ const result = await DocumentPicker.getDocumentAsync();
19
+
20
+ // New data from latest version of expo-document-picker
21
+ const { assets, canceled } = result;
22
+
23
+ // Old data from older version of expo-document-picker
24
+ const { type, ...rest } = result;
25
+
26
+ // Applicable to latest version of expo-document-picker
27
+ if (canceled) {
28
+ return {
29
+ cancelled: true,
30
+ };
31
+ }
32
+ // Applicable to older version of expo-document-picker
19
33
  if (type === 'cancel') {
20
34
  return {
21
35
  cancelled: true,
22
36
  };
23
37
  }
38
+ // Applicable to latest version of expo-document-picker
39
+ if (assets) {
40
+ return {
41
+ assets,
42
+ cancelled: false,
43
+ };
44
+ }
45
+ // Applicable to older version of expo-document-picker
24
46
  return {
47
+ assets: [rest],
25
48
  cancelled: false,
26
- docs: [rest],
27
49
  };
28
50
  } catch (err) {
29
51
  return {