From 6a87bb4e513ef7889761850f8432382d8e1e7753 Mon Sep 17 00:00:00 2001 From: Patrick Binder <47981658+gwosd@users.noreply.github.com> Date: Wed, 3 Jul 2024 22:12:13 +0200 Subject: [PATCH] issue #107 --- CHANGELOG.md | 1 + app/lib/widget/addWeightDialog.dart | 13 +++++-------- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d11e0dea..b221b185 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,7 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ### Bugfix 🐛: - Fix broken color of linechart - Allow adding measurements older than 2 years +- Fixed a bug where saving an unmodified measurement resulted in it being deleted ## [0.7.0] - 2024-05-29 diff --git a/app/lib/widget/addWeightDialog.dart b/app/lib/widget/addWeightDialog.dart index 14e08582..ab83ca4c 100644 --- a/app/lib/widget/addWeightDialog.dart +++ b/app/lib/widget/addWeightDialog.dart @@ -173,7 +173,10 @@ Future showAddWeightDialog({ date: currentDate, ), ); - if (!wasInserted) { + if ( + !wasInserted && !(editMode && currentDate == initialDate && + currentSliderValue == initialSliderValue) + ) { ScaffoldMessenger.of(context).showSnackBar( const SnackBar( content: Text( @@ -183,15 +186,9 @@ Future showAddWeightDialog({ ) ); } - Navigator.pop(context, true); + Navigator.pop(context, wasInserted); }, enabled: true, - // enabled: editMode - // ? !( - // currentDate == initialDate && - // initialSliderValue == currentSliderValue - // ) - // : !editMode, ), ); }