added delete confirmation dialog for chat messages and refined deletion logic flow

This commit is contained in:
2026-05-09 22:32:45 +02:00
parent 79a6d9a594
commit 9accb488f2
@@ -140,12 +140,22 @@ void showChatMessageOptionsDialog(
},
),
if (canDelete)
AsyncListTile(
ListTile(
leading: const Icon(Icons.delete_outline),
title: const Text('Nachricht löschen'),
onPressed: () async {
onTap: () {
ConfirmDialog(
title: 'Nachricht löschen?',
content: 'Die Nachricht wird für alle Teilnehmer gelöscht.',
confirmButton: 'Löschen',
onConfirmAsync: () async {
await DeleteMessage(chatData.token, bubbleData.id).run();
if (sheetCtx.mounted) sheetCtx.read<ChatBloc>().refresh();
if (!sheetCtx.mounted) return;
final bloc = sheetCtx.read<ChatBloc>();
Navigator.of(sheetCtx).pop();
bloc.refresh();
},
).asDialog(sheetCtx);
},
),
DebugTile(sheetCtx).jsonData(bubbleData.toJson()),