Number formatting settings, recipe ingredient amount calculation

This commit is contained in:
VincentMeilinger
2024-03-20 08:53:58 +01:00
parent 054e222d8e
commit 7b59c79222
10 changed files with 211 additions and 39 deletions

View File

@@ -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 {