commit 7d11a003dae8b8afaf14c3e2e6c331e7380f6302
parent 29e3b6ed68b40860c42f3904565241a742105796
Author: Marc Stibane <marc@taler.net>
Date: Tue, 4 Jul 2023 16:27:11 +0200
dismiss sheet even earlyer on bank-integrated withdrawals
Diffstat:
2 files changed, 18 insertions(+), 13 deletions(-)
diff --git a/TalerWallet1/Backend/Transaction.swift b/TalerWallet1/Backend/Transaction.swift
@@ -40,8 +40,8 @@ enum TransactionMinorState: String, Codable {
case repurchase
case bankRegisterReserve = "bank-register-reserve"
case bankConfirmTransfer = "bank-confirm-transfer"
- case withdrawCoins = "withdraw-coins"
case exchangeWaitReserve = "exchange-wait-reserve"
+ case withdrawCoins = "withdraw-coins"
case abortingBank = "aborting-bank"
case refused
case withdraw
diff --git a/TalerWallet1/Views/Transactions/TransactionDetailView.swift b/TalerWallet1/Views/Transactions/TransactionDetailView.swift
@@ -105,8 +105,12 @@ struct TransactionDetailView: View {
doneAction() // if this view is in a sheet this action will dissmiss it
} else if newMajor == .pending {
if let newMinor {
- if newMinor == .withdrawCoins { // coin-withdrawal has started
- symLog.log("newTxState.minor == withdrawCoins => dismiss sheet")
+ if newMinor == .exchangeWaitReserve { // user did confirm on bank website
+// symLog.log("newTxState.minor == exchangeWaitReserve => change Buttons")
+ symLog.log("newTxState.minor == exchangeWaitReserve => dismiss sheet")
+ doneAction() // if this view is in a sheet this action will dissmiss it
+ } else if newMinor == .withdrawCoins { // coin-withdrawal has started
+ symLog.log("newTxState.minor == withdrawCoins => dismiss sheet")
doneAction() // if this view is in a sheet this action will dissmiss it
} else {
symLog.log("ignoring newTxState: \(newMajor):\(newMinor)")
@@ -172,24 +176,25 @@ struct TransactionDetailView: View {
ManualDetails(common: common, details: withdrawalDetails)
case .bankIntegrated: // "Confirm with bank"
- VStack {
+ let confirmed = withdrawalDetails.confirmed ?? false
+ if !confirmed {
if let confirmationUrl = withdrawalDetails.bankConfirmationUrl {
if let destination = URL(string: confirmationUrl) {
- // Show Hint that User should Confirm on bank website
- Text("Waiting for bank confirmation")
- .multilineTextAlignment(.leading)
- .listRowSeparator(.hidden)
- Link("Confirm with bank", destination: destination)
- .buttonStyle(TalerButtonStyle(type: .prominent, narrow: false, aligned: .center))
- .padding(.horizontal)
-
+ VStack { // Show Hint that User should Confirm on bank website
+ Text("Waiting for bank confirmation")
+ .multilineTextAlignment(.leading)
+ .listRowSeparator(.hidden)
+ Link("Confirm with bank", destination: destination)
+ .buttonStyle(TalerButtonStyle(type: .prominent, narrow: false, aligned: .center))
+ .padding(.horizontal)
+ }
}
}
}
}
} // ManualDetails or Confirm with bank
ThreeAmountsSheet(common: common, topTitle: String(localized: "Chosen amount to withdraw:"),
- baseURL: withdrawalTransaction.details.exchangeBaseUrl, large: true)
+ baseURL: details.exchangeBaseUrl, large: false)
case .payment(let paymentTransaction):
let details = paymentTransaction.details
let info = details.info