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, ), ); }