fix: Do not ask for reason to delete not sent messages
This commit is contained in:
parent
c7ea797f34
commit
c273ff64a1
1 changed files with 15 additions and 13 deletions
|
|
@ -753,19 +753,21 @@ class ChatController extends State<ChatPageWithRoom> {
|
||||||
}
|
}
|
||||||
|
|
||||||
void redactEventsAction() async {
|
void redactEventsAction() async {
|
||||||
final reasonInput = await showTextInputDialog(
|
final reasonInput = selectedEvents.any((event) => event.status.isSent)
|
||||||
context: context,
|
? await showTextInputDialog(
|
||||||
title: L10n.of(context)!.redactMessage,
|
context: context,
|
||||||
message: L10n.of(context)!.redactMessageDescription,
|
title: L10n.of(context)!.redactMessage,
|
||||||
isDestructiveAction: true,
|
message: L10n.of(context)!.redactMessageDescription,
|
||||||
textFields: [
|
isDestructiveAction: true,
|
||||||
DialogTextField(
|
textFields: [
|
||||||
hintText: L10n.of(context)!.optionalRedactReason,
|
DialogTextField(
|
||||||
),
|
hintText: L10n.of(context)!.optionalRedactReason,
|
||||||
],
|
),
|
||||||
okLabel: L10n.of(context)!.remove,
|
],
|
||||||
cancelLabel: L10n.of(context)!.cancel,
|
okLabel: L10n.of(context)!.remove,
|
||||||
);
|
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…
Add table
Add a link
Reference in a new issue