Add a generic ErrorAlertInfo type.

Adopt it in Location Sharing and Polls.
This commit is contained in:
Doug
2022-03-03 16:30:00 +00:00
committed by Doug
parent cfeae5bc64
commit 9602d1ee03
8 changed files with 85 additions and 57 deletions
@@ -64,15 +64,15 @@ class TimelinePollViewModel: TimelinePollViewModelType, TimelinePollViewModelPro
}
func showAnsweringFailure() {
state.bindings.alertInfo = TimelinePollErrorAlertInfo(id: .failedSubmittingAnswer,
title: VectorL10n.pollTimelineVoteNotRegisteredTitle,
subtitle: VectorL10n.pollTimelineVoteNotRegisteredSubtitle)
state.bindings.alertInfo = ErrorAlertInfo(id: TimelinePollAlertType.failedSubmittingAnswer,
title: VectorL10n.pollTimelineVoteNotRegisteredTitle,
message: VectorL10n.pollTimelineVoteNotRegisteredSubtitle)
}
func showClosingFailure() {
state.bindings.alertInfo = TimelinePollErrorAlertInfo(id: .failedClosingPoll,
title: VectorL10n.pollTimelineNotClosedTitle,
subtitle: VectorL10n.pollTimelineNotClosedSubtitle)
state.bindings.alertInfo = ErrorAlertInfo(id: TimelinePollAlertType.failedClosingPoll,
title: VectorL10n.pollTimelineNotClosedTitle,
message: VectorL10n.pollTimelineNotClosedSubtitle)
}
// MARK: - Private