[LLC] Fix upload attachments update method
Signed-off-by: Sahil Kumar <[email protected]>
This commit is contained in:
@@ -229,12 +229,13 @@ class Channel {
|
|||||||
client.logger.info('Uploading ${it.id} attachment...');
|
client.logger.info('Uploading ${it.id} attachment...');
|
||||||
|
|
||||||
void updateAttachment(Attachment attachment) {
|
void updateAttachment(Attachment attachment) {
|
||||||
message = message.copyWith(
|
final index = message.attachments.indexWhere((it) {
|
||||||
attachments: message.attachments.map((it) {
|
return it.id == attachment.id;
|
||||||
if (it.id != attachment.id) return it;
|
});
|
||||||
return attachment;
|
if (index != -1) {
|
||||||
}).toList(growable: false));
|
message.attachments[index] = attachment;
|
||||||
state?.addMessage(message);
|
state?.addMessage(message);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void onSendProgress(int sent, int total) {
|
void onSendProgress(int sent, int total) {
|
||||||
|
|||||||
Reference in New Issue
Block a user