mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-30 05:06:58 +02:00
Add a generic ErrorAlertInfo type.
Adopt it in Location Sharing and Polls.
This commit is contained in:
@@ -81,7 +81,7 @@ struct LocationSharingView: View {
|
||||
.alert(item: $context.alertInfo) { info in
|
||||
if let secondaryButton = info.secondaryButton {
|
||||
return Alert(title: Text(info.title),
|
||||
message: subtitleTextForAlertInfo(info),
|
||||
message: info.messageText,
|
||||
primaryButton: .default(Text(info.primaryButton.title)) {
|
||||
info.primaryButton.action?()
|
||||
},
|
||||
@@ -90,7 +90,7 @@ struct LocationSharingView: View {
|
||||
})
|
||||
} else {
|
||||
return Alert(title: Text(info.title),
|
||||
message: subtitleTextForAlertInfo(info),
|
||||
message: info.messageText,
|
||||
dismissButton: .default(Text(info.primaryButton.title)) {
|
||||
info.primaryButton.action?()
|
||||
})
|
||||
@@ -108,14 +108,6 @@ struct LocationSharingView: View {
|
||||
ActivityIndicator()
|
||||
}
|
||||
}
|
||||
|
||||
private func subtitleTextForAlertInfo(_ alertInfo: LocationSharingErrorAlertInfo) -> Text? {
|
||||
guard let subtitle = alertInfo.subtitle else {
|
||||
return nil
|
||||
}
|
||||
|
||||
return Text(subtitle)
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - Previews
|
||||
|
||||
Reference in New Issue
Block a user