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 66bf8f0428
commit 572b1ff3bb
8 changed files with 85 additions and 57 deletions
@@ -99,16 +99,10 @@ struct TimelinePollViewState: BindableState {
}
struct TimelinePollViewStateBindings {
var alertInfo: TimelinePollErrorAlertInfo?
var alertInfo: ErrorAlertInfo<TimelinePollAlertType>?
}
struct TimelinePollErrorAlertInfo: Identifiable {
enum AlertType {
case failedClosingPoll
case failedSubmittingAnswer
}
let id: AlertType
let title: String
let subtitle: String
enum TimelinePollAlertType {
case failedClosingPoll
case failedSubmittingAnswer
}