fix: Delete now deletes a single image
This commit is contained in:
@@ -103,11 +103,20 @@ class ImageActionsModal extends StatelessWidget {
|
|||||||
color: StreamChatTheme.of(context).colorTheme.accentRed,
|
color: StreamChatTheme.of(context).colorTheme.accentRed,
|
||||||
),
|
),
|
||||||
() {
|
() {
|
||||||
Navigator.pop(context);
|
if (message.attachments.length > 1 ||
|
||||||
Navigator.pop(context);
|
message.text.isNotEmpty) {
|
||||||
StreamChannel.of(context)
|
var channel = StreamChannel.of(context).channel;
|
||||||
.channel
|
channel.updateMessage(
|
||||||
.deleteMessage(message);
|
message..attachments.removeAt(currentIndex));
|
||||||
|
Navigator.pop(context);
|
||||||
|
Navigator.pop(context);
|
||||||
|
} else {
|
||||||
|
var channel = StreamChannel.of(context).channel;
|
||||||
|
channel.deleteMessage(message).then((value) {
|
||||||
|
Navigator.pop(context);
|
||||||
|
Navigator.pop(context);
|
||||||
|
});
|
||||||
|
}
|
||||||
},
|
},
|
||||||
color: StreamChatTheme.of(context).colorTheme.accentRed,
|
color: StreamChatTheme.of(context).colorTheme.accentRed,
|
||||||
),
|
),
|
||||||
|
|||||||
Reference in New Issue
Block a user