UI bug fixes (regarding recipe servings adjustment)
This commit is contained in:
@@ -68,7 +68,7 @@ class ObservableRecipeDetail: ObservableObject {
|
||||
recipeInstructions = recipeDetail.recipeInstructions
|
||||
nutrition = recipeDetail.nutrition
|
||||
|
||||
ingredientMultiplier = Double(recipeDetail.recipeYield)
|
||||
ingredientMultiplier = Double(recipeDetail.recipeYield == 0 ? 1 : recipeDetail.recipeYield)
|
||||
}
|
||||
|
||||
func toRecipeDetail() -> RecipeDetail {
|
||||
|
||||
@@ -354,12 +354,6 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"1,42 (Comma)" : {
|
||||
|
||||
},
|
||||
"1.42 (Point)" : {
|
||||
|
||||
},
|
||||
"A recipe with that name already exists." : {
|
||||
"localizations" : {
|
||||
@@ -846,6 +840,9 @@
|
||||
},
|
||||
"cl" : {
|
||||
|
||||
},
|
||||
"Comma (e.g. 1,42)" : {
|
||||
|
||||
},
|
||||
"Configure what is stored on your device." : {
|
||||
"localizations" : {
|
||||
@@ -1103,9 +1100,6 @@
|
||||
},
|
||||
"Decimal number format" : {
|
||||
|
||||
},
|
||||
"Decimal Separator" : {
|
||||
|
||||
},
|
||||
"Delete" : {
|
||||
"localizations" : {
|
||||
@@ -2222,6 +2216,9 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"Marked ingredients could not be adjusted!" : {
|
||||
|
||||
},
|
||||
"mg" : {
|
||||
|
||||
@@ -2764,6 +2761,9 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"Point (e.g. 1.42)" : {
|
||||
|
||||
},
|
||||
"pound" : {
|
||||
|
||||
@@ -3885,9 +3885,6 @@
|
||||
},
|
||||
"tsp" : {
|
||||
|
||||
},
|
||||
"Unable to adjust some ingredients!" : {
|
||||
|
||||
},
|
||||
"Unable to complete action." : {
|
||||
"localizations" : {
|
||||
|
||||
@@ -67,10 +67,10 @@ struct RecipeIngredientSection: View {
|
||||
if viewModel.observableRecipeDetail.ingredientMultiplier != Double(viewModel.observableRecipeDetail.recipeYield) {
|
||||
HStack() {
|
||||
Image(systemName: "exclamationmark.triangle.fill")
|
||||
.foregroundStyle(.red)
|
||||
Text("Unable to adjust some ingredients!")
|
||||
.foregroundStyle(.secondary)
|
||||
}
|
||||
Text("Marked ingredients could not be adjusted!")
|
||||
.foregroundStyle(.secondary)
|
||||
}.padding(.top)
|
||||
}
|
||||
|
||||
if viewModel.editMode {
|
||||
|
||||
@@ -80,9 +80,9 @@ struct SettingsView: View {
|
||||
HStack {
|
||||
Text("Decimal number format")
|
||||
Spacer()
|
||||
Picker("Decimal Separator", selection: $userSettings.decimalNumberSeparator) {
|
||||
Text("1.42 (Point)").tag(".")
|
||||
Text("1,42 (Comma)").tag(",")
|
||||
Picker("", selection: $userSettings.decimalNumberSeparator) {
|
||||
Text("Point (e.g. 1.42)").tag(".")
|
||||
Text("Comma (e.g. 1,42)").tag(",")
|
||||
}
|
||||
.pickerStyle(.menu)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user