diff options
| author | Ivan Chen <ivan@tagg.id> | 2021-08-09 19:30:37 -0400 |
|---|---|---|
| committer | Ivan Chen <ivan@tagg.id> | 2021-08-09 19:30:37 -0400 |
| commit | e2e1f03178c48b84c5401fbd157eb8505f9d67ad (patch) | |
| tree | ab6cf5e223ae8c8b2a42978e7904649db0e50ad6 /src/store/actions | |
| parent | b3d8d57ab7f7e9803579458aead4ea54ab2828db (diff) | |
Add variable in redux for caching the initial moment upload request
Diffstat (limited to 'src/store/actions')
| -rw-r--r-- | src/store/actions/user.ts | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/store/actions/user.ts b/src/store/actions/user.ts index 9d1a6f2d..da11f403 100644 --- a/src/store/actions/user.ts +++ b/src/store/actions/user.ts @@ -301,7 +301,7 @@ export const handleImageMomentUpload = async (dispatch) => { try { const handleError = (reason: string) => { - console.error('Moment video upload failed,', reason); + console.error('Moment image upload failed,', reason); dispatch({ type: setMomentUploadProgressBar.type, payload: { @@ -316,6 +316,13 @@ export const handleImageMomentUpload = status: MomentUploadStatusType.UploadingToS3, momentId: '', originalVideoDuration: 1, // assume upload time for an image is same as a 1s video + momentInfo: { + type: 'image', + uri: imageUri, + caption, + category: momentCategory, + tags: formattedTags, + }, }; // set progress bar as loading dispatch({ @@ -405,6 +412,13 @@ export const handleVideoMomentUpload = status: MomentUploadStatusType.UploadingToS3, momentId: '', originalVideoDuration: videoLength, + momentInfo: { + type: 'video', + uri: videoUri, + caption, + category: momentCategory, + tags: formattedTags, + }, }; // set progress bar as loading dispatch({ |
