fix: speed up event redaction

Signed-off-by: TheOneWithTheBraid <the-one@with-the-braid.cf>
This commit is contained in:
TheOneWithTheBraid 2022-12-20 12:20:05 +01:00
parent 5ee4514997
commit b6819aa400

View File

@ -549,10 +549,11 @@ class ChatController extends State<Chat> {
) ==
OkCancelResult.ok;
if (!confirmed) return;
for (final event in selectedEvents) {
await showFutureLoadingDialog(
context: context,
future: () async {
await showFutureLoadingDialog(
context: context,
future: () => Future.wait(
selectedEvents.map(
(event) async {
if (event.status.isSent) {
if (event.canRedact) {
await event.redactEvent();
@ -569,8 +570,11 @@ class ChatController extends State<Chat> {
} else {
await event.remove();
}
});
}
},
),
),
);
setState(() {
showEmojiPicker = false;
selectedEvents.clear();