Add preparing state to attachment upload state

Signed-off-by: Sahil Kumar <[email protected]>
This commit is contained in:
Sahil Kumar
2021-02-19 20:01:08 +05:30
parent 6f60bb8abb
commit 4b18bf8f54
9 changed files with 222 additions and 15 deletions
+2 -12
View File
@@ -308,12 +308,7 @@ class Channel {
attachments: message.attachments?.map(
(it) {
if (it.uploadState.isSuccess) return it;
return it.copyWith(
uploadState: UploadState.inProgress(
uploaded: 0,
total: it.file?.size ?? it.extraData['file_size'],
),
);
return it.copyWith(uploadState: UploadState.preparing());
},
)?.toList(),
);
@@ -370,12 +365,7 @@ class Channel {
attachments: message.attachments?.map(
(it) {
if (it.uploadState.isSuccess) return it;
return it.copyWith(
uploadState: UploadState.inProgress(
uploaded: 0,
total: it.file?.size ?? it.extraData['file_size'],
),
);
return it.copyWith(uploadState: UploadState.preparing());
},
)?.toList(),
);