Skip to content

Commit

Permalink
edit food issue fix version update
Browse files Browse the repository at this point in the history
  • Loading branch information
stylianosnicoletti committed Nov 20, 2023
1 parent da876ee commit 38547b8
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 7 deletions.
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ android {
applicationId "io.ionic.macrozilla"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 24
versionName "2.750"
versionCode 25
versionName "2.850"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
aaptOptions {
// Files and dirs to omit from the packaged assets dir, modified to accommodate modern web apps.
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "macrozilla",
"version": "2.10.0",
"version": "3.0.0",
"author": "Stelios Nicoletti",
"scripts": {
"config": "ts-node src/environments/set-env.ts",
Expand Down
18 changes: 14 additions & 4 deletions src/app/components/authorized-user/edit-food/edit-food.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export class EditFoodPage {
isSubmitted = false;
subscriptionsList: Subscription[] = [];
isFormReadyToBuild = false;


constructor(
private _router: Router,
Expand Down Expand Up @@ -142,8 +142,9 @@ export class EditFoodPage {
Saturated: formValue.Saturated,
Calories: formValue.Calories,
ServingAmount: formValue.ServingAmount,
ServingUnit: formValue.ServingUnit,
ServingUnitShortCode: formValue.ServingUnitShortCode,
// 2 Scenarios -> a) ServingUnit changes b) Preselected (does not change)
ServingUnit: this.isString(formValue.ServingUnit) ? formValue.ServingUnit : formValue.ServingUnit.Name,
ServingUnitShortCode: this.isString(formValue.ServingUnit) ? this.mapServingUnitToShortCode(formValue.ServingAmount, this.preselectedServingUnit) : this.mapServingUnitToShortCode(formValue.ServingAmount, formValue.ServingUnit),
};
}

Expand Down Expand Up @@ -234,5 +235,14 @@ export class EditFoodPage {
asIsOrder(a, b) {
return 1;
}


/**
* Is string value
* @param value
* @returns True or False
*/
isString(value): boolean {
return typeof value === 'string' || value instanceof String;
}

}

0 comments on commit 38547b8

Please sign in to comment.