fix: remove delete confirmation dialog from thread view (#402)
## Summary - Removes the `AlertDialog` popup that appeared when tapping delete in thread view - Deletion now happens immediately, matching the behaviour of the single mail view - The existing `UndoShell` widget already listens for new `UndoAction` pushes and shows a snack bar with an **Undo** button — no extra UI code needed Closes #398 Co-authored-by: Thomas SharedInbox <sharedinbox@thomas-guettler.de> Reviewed-on: https://codeberg.org/guettli/sharedinbox/pulls/402
This commit was merged in pull request #402.
This commit is contained in:
committed by
guettli
co-authored by
guettli
Thomas SharedInbox
parent
582f6764eb
commit
b0354c7423
@@ -297,25 +297,6 @@ class _EmailMessageCardState extends ConsumerState<_EmailMessageCard> {
|
||||
}
|
||||
|
||||
Future<void> _delete() async {
|
||||
final confirmed = await showDialog<bool>(
|
||||
context: context,
|
||||
builder: (ctx) => AlertDialog(
|
||||
title: const Text('Delete email'),
|
||||
content: const Text('Move this email to Trash?'),
|
||||
actions: [
|
||||
TextButton(
|
||||
onPressed: () => Navigator.pop(ctx, false),
|
||||
child: const Text('Cancel'),
|
||||
),
|
||||
TextButton(
|
||||
onPressed: () => Navigator.pop(ctx, true),
|
||||
child: const Text('Delete'),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
if (!mounted) return;
|
||||
if (confirmed == true) {
|
||||
final repo = ref.read(emailRepositoryProvider);
|
||||
// Fetch data first for IMAP undo support
|
||||
final original = await repo.getEmail(widget.email.id);
|
||||
@@ -339,5 +320,4 @@ class _EmailMessageCardState extends ConsumerState<_EmailMessageCard> {
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user