Add alert property to ErrorAlertInfo.

This commit is contained in:
Doug
2022-03-03 16:41:37 +00:00
committed by Doug
parent 9602d1ee03
commit fe5adf1bde
6 changed files with 24 additions and 25 deletions
@@ -64,13 +64,13 @@ class TimelinePollViewModel: TimelinePollViewModelType, TimelinePollViewModelPro
}
func showAnsweringFailure() {
state.bindings.alertInfo = ErrorAlertInfo(id: TimelinePollAlertType.failedSubmittingAnswer,
state.bindings.alertInfo = ErrorAlertInfo(id: .failedSubmittingAnswer,
title: VectorL10n.pollTimelineVoteNotRegisteredTitle,
message: VectorL10n.pollTimelineVoteNotRegisteredSubtitle)
}
func showClosingFailure() {
state.bindings.alertInfo = ErrorAlertInfo(id: TimelinePollAlertType.failedClosingPoll,
state.bindings.alertInfo = ErrorAlertInfo(id: .failedClosingPoll,
title: VectorL10n.pollTimelineNotClosedTitle,
message: VectorL10n.pollTimelineNotClosedSubtitle)
}
@@ -58,9 +58,7 @@ struct TimelinePollView: View {
.padding([.horizontal, .top], 2.0)
.padding([.bottom])
.alert(item: $viewModel.alertInfo) { info in
Alert(title: Text(info.title),
message: info.messageText,
dismissButton: .default(Text(VectorL10n.ok)))
info.alert
}
}