Release 1.0.0 baseline
This commit is contained in:
@@ -23,6 +23,7 @@ struct SettingsView: View {
|
||||
.toolbarBackground(Color.mealMoodBackground, for: .navigationBar)
|
||||
.toolbarBackground(.visible, for: .navigationBar)
|
||||
.environment(\.isEnabled, true)
|
||||
.toast(isShowing: $viewModel.showToast, message: viewModel.toastMessage)
|
||||
}
|
||||
|
||||
@ViewBuilder
|
||||
@@ -64,7 +65,8 @@ struct SettingsView: View {
|
||||
Task {
|
||||
let granted = await viewModel.requestCalendarAccess()
|
||||
if granted {
|
||||
settings.syncEnabled = true
|
||||
let hasCalendar = viewModel.ensureValidCalendarSelection(settings: settings)
|
||||
settings.syncEnabled = hasCalendar
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@@ -214,7 +216,8 @@ struct SettingsView: View {
|
||||
.tint(.mealMoodCoral)
|
||||
.onAppear {
|
||||
if settings.syncEnabled {
|
||||
viewModel.loadCalendars()
|
||||
let hasCalendar = viewModel.ensureValidCalendarSelection(settings: settings)
|
||||
settings.syncEnabled = hasCalendar
|
||||
}
|
||||
}
|
||||
.alert("calendar_permission_title", isPresented: $viewModel.showCalendarPermissionAlert) {
|
||||
|
||||
Reference in New Issue
Block a user