[UI-Kit -> ImageActionsModal] Fix delete image
Signed-off-by: Sahil Kumar <[email protected]>
This commit is contained in:
@@ -103,15 +103,20 @@ class ImageActionsModal extends StatelessWidget {
|
|||||||
color: StreamChatTheme.of(context).colorTheme.accentRed,
|
color: StreamChatTheme.of(context).colorTheme.accentRed,
|
||||||
),
|
),
|
||||||
() {
|
() {
|
||||||
|
final channel = StreamChannel.of(context).channel;
|
||||||
if (message.attachments.length > 1 ||
|
if (message.attachments.length > 1 ||
|
||||||
message.text.isNotEmpty) {
|
message.text.isNotEmpty) {
|
||||||
var channel = StreamChannel.of(context).channel;
|
final remainingAttachments = [...message.attachments]
|
||||||
channel.updateMessage(
|
..removeAt(currentIndex);
|
||||||
message..attachments.removeAt(currentIndex));
|
channel.updateMessage(message.copyWith(
|
||||||
|
attachments: remainingAttachments.map((e) {
|
||||||
|
return e.copyWith(
|
||||||
|
uploadState: UploadState.success());
|
||||||
|
}).toList(),
|
||||||
|
));
|
||||||
Navigator.pop(context);
|
Navigator.pop(context);
|
||||||
Navigator.pop(context);
|
Navigator.pop(context);
|
||||||
} else {
|
} else {
|
||||||
var channel = StreamChannel.of(context).channel;
|
|
||||||
channel.deleteMessage(message).then((value) {
|
channel.deleteMessage(message).then((value) {
|
||||||
Navigator.pop(context);
|
Navigator.pop(context);
|
||||||
Navigator.pop(context);
|
Navigator.pop(context);
|
||||||
|
|||||||
Reference in New Issue
Block a user