commit bc514fca36adb5b5e84957da3933c4322c383a1e
parent bb0f7518c5c60a7cd3263476fdaedba26b7480ab
Author: Marc Stibane <marc@taler.net>
Date: Mon, 16 Sep 2024 19:38:42 +0200
Repurchase
Diffstat:
2 files changed, 23 insertions(+), 21 deletions(-)
diff --git a/TalerWallet1/Views/Sheets/Payment/PaymentDone.swift b/TalerWallet1/Views/Sheets/Payment/PaymentDone.swift
@@ -54,7 +54,7 @@ struct PaymentDone: View {
LoadingView(scopeInfo: nil, message: "Paying...")
.task {
if let confirmPayResult = try? await model.confirmPayM(transactionId) {
- // symLog.log(confirmPayResult as Any)
+// symLog.log(confirmPayResult as Any)
if confirmPayResult.type == "done" {
paymentDone = true
}
diff --git a/TalerWallet1/Views/Sheets/Payment/PaymentView.swift b/TalerWallet1/Views/Sheets/Payment/PaymentView.swift
@@ -181,28 +181,30 @@ struct PaymentView: View {
}
.listStyle(myListStyle.style).anyView
.safeAreaInset(edge: .bottom) {
- if let effective {
- VStack {
- NavigationLink(destination: LazyView {
- PaymentDone(stack: stack.push(),
- currencyInfo: $currencyInfo,
- transactionId: preparePayResult.transactionId)
- }) {
- let formatted = raw.formatted(currencyInfo, isNegative: false)
- Text("Pay \(formatted) now")
+ if !paid {
+ if let effective {
+ VStack {
+ NavigationLink(destination: LazyView {
+ PaymentDone(stack: stack.push(),
+ currencyInfo: $currencyInfo,
+ transactionId: preparePayResult.transactionId)
+ }) {
+ let formatted = raw.formatted(currencyInfo, isNegative: false)
+ Text("Pay \(formatted) now")
+ }
+ .buttonStyle(TalerButtonStyle(type: .prominent))
+ .padding(.horizontal)
+ Text("Payment is made in \(currencyInfo.scope.currency)")
+ .talerFont(.callout)
+ }
+ } else {
+ Button("Cancel") {
+ dismissTop(stack.push())
}
- .buttonStyle(TalerButtonStyle(type: .prominent))
+ .buttonStyle(TalerButtonStyle(type: .bordered))
.padding(.horizontal)
- Text("Payment is made in \(currencyInfo.scope.currency)")
- .talerFont(.callout)
- }
- } else {
- Button("Cancel", action: {
- dismissTop(stack.push())
- })
- .buttonStyle(TalerButtonStyle(type: .bordered))
- .padding(.horizontal)
- } // Cancel
+ } // Cancel
+ }
}
.navigationTitle(navTitle)
.task(id: controller.currencyTicker) {