mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-20 16:42:44 +02:00
Add error handling for push sync
This commit is contained in:
@@ -21,6 +21,7 @@ import SwiftUI
|
||||
/// Also renders an optional bottom section.
|
||||
/// Used in the case of keywords, for the keyword chips and input.
|
||||
struct NotificationSettings<BottomSection: View>: View {
|
||||
@Environment(\.theme) var theme: ThemeSwiftUI
|
||||
@ObservedObject var viewModel: NotificationSettingsViewModel
|
||||
|
||||
var bottomSection: BottomSection?
|
||||
@@ -31,10 +32,18 @@ struct NotificationSettings<BottomSection: View>: View {
|
||||
header: FormSectionHeader(text: VectorL10n.settingsNotifyMeFor)
|
||||
) {
|
||||
ForEach(viewModel.viewState.ruleIds) { ruleId in
|
||||
let checked = viewModel.viewState.selectionState[ruleId] ?? false
|
||||
FormPickerItem(title: ruleId.title, selected: checked) {
|
||||
Task {
|
||||
await viewModel.update(ruleID: ruleId, isChecked: !checked)
|
||||
VStack(alignment: .leading, spacing: 4) {
|
||||
let checked = viewModel.viewState.selectionState[ruleId] ?? false
|
||||
FormPickerItem(title: ruleId.title, selected: checked) {
|
||||
viewModel.update(ruleID: ruleId, isChecked: !checked)
|
||||
}
|
||||
|
||||
if viewModel.isRuleOutOfSync(ruleId) {
|
||||
Text(VectorL10n.settingsPushRulesError)
|
||||
.font(theme.fonts.caption1)
|
||||
.foregroundColor(theme.colors.alert)
|
||||
.padding(.horizontal)
|
||||
.padding(.bottom, 16)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user