Showing an error message if user selects a bank that does not support FinTS 3.0
This commit is contained in:
parent
685693ab23
commit
4d2f464569
|
@ -21,6 +21,9 @@
|
|||
"Select Bank Dialog Title" = "Select your bank ...";
|
||||
"Search by bank code, bank name or city" = "Search by bank code, bank name or city";
|
||||
|
||||
"Bank does not support FinTS 3.0" = "Bank does not support FinTS 3.0";
|
||||
"%@ does not support FinTS 3.0." = "%@ does not support FinTS 3.0.\n\nIn this app only banks supporting the German banking standard FinTS 3.0 can be used.";
|
||||
|
||||
|
||||
/* AddAccountDialog */
|
||||
|
||||
|
|
|
@ -21,6 +21,9 @@
|
|||
"Select Bank Dialog Title" = "Bank auswählen";
|
||||
"Search by bank code, bank name or city" = "Suche mittels Bankleitzahl, Bankname oder Ort";
|
||||
|
||||
"Bank does not support FinTS 3.0" = "FinTS 3.0 wird von Bank nicht unterstützt";
|
||||
"%@ does not support FinTS 3.0." = "%@ unterstützt FinTS 3.0 nicht.\n\nIn dieser App können nur Banken verwendet werden, die den deutschen Online-Banking Standard FinTS 3.0 unterstützen.";
|
||||
|
||||
|
||||
/* AddAccountDialog */
|
||||
|
||||
|
|
|
@ -25,6 +25,9 @@ struct SelectBankDialog: View {
|
|||
@State private var searchResult: [BankInfo]
|
||||
|
||||
|
||||
@State private var errorMessage: Message? = nil
|
||||
|
||||
|
||||
init(_ selectedBank: Binding<BankInfo?>) {
|
||||
self._selectedBank = selectedBank
|
||||
|
||||
|
@ -61,6 +64,9 @@ struct SelectBankDialog: View {
|
|||
}
|
||||
}
|
||||
}
|
||||
.alert(item: $errorMessage) { message in
|
||||
Alert(title: message.title, message: message.message, dismissButton: message.primaryButton)
|
||||
}
|
||||
.showNavigationBarTitle("Select Bank Dialog Title")
|
||||
}
|
||||
|
||||
|
@ -70,10 +76,17 @@ struct SelectBankDialog: View {
|
|||
}
|
||||
|
||||
private func handleSelectedBank(_ bank: BankInfo) {
|
||||
if bank.supportsFinTs3_0 {
|
||||
self.selectedBank = bank
|
||||
|
||||
presentation.wrappedValue.dismiss()
|
||||
}
|
||||
else {
|
||||
self.selectedBank = nil
|
||||
|
||||
self.errorMessage = Message(title: Text("Bank does not support FinTS 3.0"), message: Text("\(bank.name) does not support FinTS 3.0."))
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue