fix snackbar showing also showing on other screens (#155)
All checks were successful
Pull Request Pipeline / test (pull_request) Successful in 2m10s
Pull Request Pipeline / lint (pull_request) Successful in 2m12s

This commit is contained in:
2026-01-13 21:35:10 +01:00
parent ed642e3d4f
commit 1b297d15b0
2 changed files with 17 additions and 23 deletions

View File

@@ -83,12 +83,13 @@ class _GroupDetailViewState extends State<GroupDetailView> {
],
),
).then((confirmed) async {
if (confirmed == true && context.mounted) {
if (confirmed == true && mounted) {
bool success = await db.groupDao.deleteGroup(groupId: widget.groupToEdit!.id);
if (!context.mounted) return;
if (success) {
Navigator.pop(context);
} else {
if (!mounted) return;
showSnackbar(message: loc.error_deleting_group);
}
}