From 5acba2c23a6f63e2ec0ec93e5755a532f2ac711d Mon Sep 17 00:00:00 2001 From: Brandon Presley Date: Fri, 31 May 2024 12:52:50 +1200 Subject: [PATCH] =?UTF-8?q?Fix=20entering=20per=20serving=20-=201.0.22=20?= =?UTF-8?q?=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Honestly i'm getting a bit mind-fucked by this. --- fastlane/metadata/android/en-US/changelogs/233.txt | 1 + lib/utils.dart | 6 +----- pubspec.yaml | 2 +- 3 files changed, 3 insertions(+), 6 deletions(-) create mode 100644 fastlane/metadata/android/en-US/changelogs/233.txt diff --git a/fastlane/metadata/android/en-US/changelogs/233.txt b/fastlane/metadata/android/en-US/changelogs/233.txt new file mode 100644 index 0000000..0036d8d --- /dev/null +++ b/fastlane/metadata/android/en-US/changelogs/233.txt @@ -0,0 +1 @@ +- Fix entering per serving diff --git a/lib/utils.dart b/lib/utils.dart index 7f1704e..218e146 100644 --- a/lib/utils.dart +++ b/lib/utils.dart @@ -24,11 +24,7 @@ EntriesCompanion calculateEntry({ final grams = quantity / 4.184; quantity100G = grams / 100; } else if (unit == 'serving') { - final weightG = convertToGrams( - food.servingWeight1G ?? 100, - food.servingUnit ?? 'grams', - ); - quantity100G = quantity * (weightG / 100); + quantity100G = quantity; } else { quantity100G = convertToGrams(quantity, unit) / 100; } diff --git a/pubspec.yaml b/pubspec.yaml index c5e6013..0cb34c9 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,7 @@ name: fit_book description: Track your calories - Completely offline! publish_to: none -version: 1.0.21+22 +version: 1.0.22+23 environment: sdk: '>=3.3.3 <4.0.0' dependencies: