@amityco/ts-sdk-react-native 6.22.1-431d613.0 → 6.22.1-600ab29.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@amityco/ts-sdk-react-native",
3
- "version": "6.22.1-431d613.0",
3
+ "version": "6.22.1-600ab29.0",
4
4
  "license": "CC-BY-ND-4.0",
5
5
  "author": "amity.co <developers@amity.co> (https://amity.co)",
6
6
  "description": "Amity Social Cloud Typescript SDK",
@@ -10,7 +10,7 @@ export const rebuildFormDataWithMimeType = (formData: FormData): FormData => {
10
10
  // In ReactNative Android, we need to define a file type for all upload items; otherwise backend will reject a request
11
11
  // @ts-ignore - we need to modify `type` because in android this value will not set by default (https://github.com/axios/axios/issues/4823)
12
12
  imageFile.type = mime.getType(imageFile.uri);
13
- newFormData.append('files', imageFile, imageFile.name);
13
+ newFormData.append('files', imageFile);
14
14
 
15
15
  return newFormData;
16
16
  };
@@ -25,28 +25,20 @@ export const createOptimisticEvent = (
25
25
 
26
26
  if (!fileObject) return;
27
27
 
28
- return callback(
29
- saveOptimisticToCache(
30
- isVideo
31
- ? {
32
- ...payload,
33
- data: {
34
- ...payload.data,
35
- fileId: undefined,
36
- videoFileId: { original: undefined },
37
- fileData: fileObject.uri,
38
- },
39
- }
40
- : {
41
- ...payload,
42
- data: {
43
- ...payload.data,
44
- fileId: undefined,
45
- fileData: fileObject.uri,
46
- },
47
- },
48
- ),
49
- );
28
+ const optimisticData = {
29
+ ...payload,
30
+ data: {
31
+ ...payload.data,
32
+ fileId: undefined,
33
+ fileData: fileObject.uri,
34
+ },
35
+ };
36
+
37
+ if (isVideo) {
38
+ optimisticData.data.videoFileId = { original: undefined };
39
+ }
40
+
41
+ return callback(saveOptimisticToCache(optimisticData));
50
42
  }
51
43
 
52
44
  return callback(