commit 6a9057d59fe665b1c72b52dfc179470c591e93cf
parent d3b1cb165804b6a62c5693029b0942f231ee1797
Author: Marc Stibane <marc@taler.net>
Date: Mon, 3 Jul 2023 09:45:36 +0200
Confirm later instead of Done for bank-integrated withdrawals
Diffstat:
2 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/TalerWallet1/Backend/Transaction.swift b/TalerWallet1/Backend/Transaction.swift
@@ -414,6 +414,15 @@ enum Transaction: Decodable, Hashable, Identifiable {
var isResumable : Bool { common.txActions.contains(.resume) }
var isSuspendable: Bool { common.txActions.contains(.suspend) }
+ var shouldConfirm: Bool {
+ switch self {
+ case .withdrawal(let withdrawalTransaction):
+ let details = withdrawalTransaction.details.withdrawalDetails
+ return details.type == .bankIntegrated // && details.bankConfirmationUrl != nil
+ default:
+ return false
+ }
+ }
var common: TransactionCommon {
switch self {
case .dummy(let dummyTransaction):
diff --git a/TalerWallet1/Views/Transactions/TransactionDetailView.swift b/TalerWallet1/Views/Transactions/TransactionDetailView.swift
@@ -89,8 +89,8 @@ struct TransactionDetailView: View {
.listStyle(myListStyle.style).anyView
.safeAreaInset(edge: .bottom) {
if let doneAction {
- Button("Done", action: doneAction)
- .buttonStyle(TalerButtonStyle(type: .prominent))
+ Button(transaction.shouldConfirm ? "Confirm later" : "Done", action: doneAction)
+ .buttonStyle(TalerButtonStyle(type: transaction.shouldConfirm ? .bordered : .prominent))
.padding(.horizontal)
}
}