Number formatting settings, recipe ingredient amount calculation
This commit is contained in:
@@ -76,6 +76,20 @@ struct SettingsView: View {
|
||||
}
|
||||
}
|
||||
|
||||
Section {
|
||||
HStack {
|
||||
Text("Decimal number format")
|
||||
Spacer()
|
||||
Picker("Decimal Separator", selection: $userSettings.decimalNumberSeparator) {
|
||||
Text("1.42 (Point)").tag(".")
|
||||
Text("1,42 (Comma)").tag(",")
|
||||
}
|
||||
.pickerStyle(.menu)
|
||||
}
|
||||
} footer: {
|
||||
Text("This setting will take effect after the app is restarted. It affects the adjustment of ingredient quantities.")
|
||||
}
|
||||
|
||||
Section {
|
||||
Toggle(isOn: $userSettings.storeRecipes) {
|
||||
Text("Offline recipes")
|
||||
@@ -170,12 +184,6 @@ struct SettingsView: View {
|
||||
} message: {
|
||||
Text(viewModel.alertType.getMessage())
|
||||
}
|
||||
.onDisappear {
|
||||
Task {
|
||||
userSettings.lastUpdate = .distantPast
|
||||
await appState.updateAllRecipeDetails()
|
||||
}
|
||||
}
|
||||
.task {
|
||||
await viewModel.getUserData()
|
||||
}
|
||||
@@ -239,3 +247,4 @@ extension SettingsView {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user