fix: Do not ask for reason to delete not sent messages

pull/591/head
Krille 2 years ago
parent c7ea797f34
commit c273ff64a1
No known key found for this signature in database

@ -753,7 +753,8 @@ class ChatController extends State<ChatPageWithRoom> {
} }
void redactEventsAction() async { void redactEventsAction() async {
final reasonInput = await showTextInputDialog( final reasonInput = selectedEvents.any((event) => event.status.isSent)
? await showTextInputDialog(
context: context, context: context,
title: L10n.of(context)!.redactMessage, title: L10n.of(context)!.redactMessage,
message: L10n.of(context)!.redactMessageDescription, message: L10n.of(context)!.redactMessageDescription,
@ -765,7 +766,8 @@ class ChatController extends State<ChatPageWithRoom> {
], ],
okLabel: L10n.of(context)!.remove, okLabel: L10n.of(context)!.remove,
cancelLabel: L10n.of(context)!.cancel, cancelLabel: L10n.of(context)!.cancel,
); )
: <String>[];
if (reasonInput == null) return; if (reasonInput == null) return;
final reason = reasonInput.single.isEmpty ? null : reasonInput.single; final reason = reasonInput.single.isEmpty ? null : reasonInput.single;
for (final event in selectedEvents) { for (final event in selectedEvents) {

Loading…
Cancel
Save