mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-22 01:22:46 +02:00
MESSENGER-4272 add advertizement button
This commit is contained in:
committed by
Frank Rotermund
parent
e851352904
commit
e958fa574e
+18
-4
@@ -62,10 +62,7 @@ struct AuthenticationServerSelectionScreen: View {
|
||||
serverForm
|
||||
.alert(item: $viewModel.alertInfo) { $0.alert }
|
||||
.alert(isPresented: $showAlertForInvalidServer) {
|
||||
Alert(
|
||||
title: Text(BWIL10n.authenticationServerSelectionServerDeniedTitle),
|
||||
message: Text(BWIL10n.authenticationServerSelectionServerDeniedMessage),
|
||||
dismissButton: .default(Text(VectorL10n.ok)))
|
||||
invalidServerAlert()
|
||||
}
|
||||
if BWIBuildSettings.shared.authScreenShowTestServerOptions {
|
||||
serverSelectionButton
|
||||
@@ -242,6 +239,23 @@ struct AuthenticationServerSelectionScreen: View {
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
// bwi: show alert with advertizment link if URL is valid
|
||||
private func invalidServerAlert() -> Alert {
|
||||
if let url = URL(string: BWIBuildSettings.shared.bumAdvertizementURLString) {
|
||||
return Alert(
|
||||
title: Text(BWIL10n.authenticationServerSelectionServerDeniedTitle),
|
||||
message: Text(BWIL10n.authenticationServerSelectionServerDeniedMessage),
|
||||
primaryButton: .default(Text(BWIL10n.authenticationServerSelectionServerDeniedAdvertizementWebsiteButton), action: {UIApplication.shared.open(url)}),
|
||||
secondaryButton: .default(Text(VectorL10n.ok)))
|
||||
|
||||
} else {
|
||||
return Alert(
|
||||
title: Text(BWIL10n.authenticationServerSelectionServerDeniedTitle),
|
||||
message: Text(BWIL10n.authenticationServerSelectionServerDeniedMessage),
|
||||
dismissButton: .default(Text(VectorL10n.ok)))
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user