[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-taler-ios] 26/54: PeerPullDebit
From: |
gnunet |
Subject: |
[taler-taler-ios] 26/54: PeerPullDebit |
Date: |
Fri, 30 Jun 2023 22:33:58 +0200 |
This is an automated email from the git hooks/post-receive script.
marc-stibane pushed a commit to branch master
in repository taler-ios.
commit 5a206a0935844ddfea8079e4fc1108fcfd5ddc2d
Author: Marc Stibane <marc@taler.net>
AuthorDate: Tue Jun 27 14:29:46 2023 +0200
PeerPullDebit
---
TalerWallet1/Views/Sheets/P2P_Sheets/P2pAcceptDone.swift | 12 +++++++++---
TalerWallet1/Views/Sheets/P2P_Sheets/P2pPayURIView.swift | 8 ++++----
TalerWallet1/Views/Sheets/P2P_Sheets/P2pReceiveURIView.swift | 3 ++-
TalerWallet1/Views/Sheets/URLSheet.swift | 4 ++--
4 files changed, 17 insertions(+), 10 deletions(-)
diff --git a/TalerWallet1/Views/Sheets/P2P_Sheets/P2pAcceptDone.swift
b/TalerWallet1/Views/Sheets/P2P_Sheets/P2pAcceptDone.swift
index 5e96d06..09e5461 100644
--- a/TalerWallet1/Views/Sheets/P2P_Sheets/P2pAcceptDone.swift
+++ b/TalerWallet1/Views/Sheets/P2P_Sheets/P2pAcceptDone.swift
@@ -8,9 +8,9 @@ import SymLog
struct P2pAcceptDone: View {
private let symLog = SymLogV()
- let navTitle = String(localized: "Received P2P")
let transactionId: String
+ let incoming: Bool
@EnvironmentObject private var model: WalletModel
@@ -32,6 +32,8 @@ struct P2pAcceptDone: View {
let _ = Self._printChanges()
let _ = symLog.vlog() // just to get the # to compare it with
.onAppear & onDisappear
#endif
+ let navTitle = incoming ? String(localized: "Received P2P")
+ : String(localized: "Paid P2P")
VStack {
TransactionDetailView(transactionId: transactionId,
reloadAction: reloadOneAction,
@@ -44,7 +46,11 @@ struct P2pAcceptDone: View {
DebugViewC.shared.setSheetID(SHEET_RCV_P2P_ACCEPT)
}.task {
do {
- _ = try await model.acceptPeerPushCreditM(transactionId)
+ if incoming {
+ _ = try await model.acceptPeerPushCreditM(transactionId)
+ } else {
+ _ = try await model.confirmPeerPullDebitM(transactionId)
+ }
finished = true
playSound(success: true)
} catch { // TODO: error
@@ -57,6 +63,6 @@ struct P2pAcceptDone: View {
// MARK: -
struct P2pAcceptDone_Previews: PreviewProvider {
static var previews: some View {
- P2pAcceptDone(transactionId: "some ID")
+ P2pAcceptDone(transactionId: "some ID", incoming: true)
}
}
diff --git a/TalerWallet1/Views/Sheets/P2P_Sheets/P2pPayURIView.swift
b/TalerWallet1/Views/Sheets/P2P_Sheets/P2pPayURIView.swift
index f244965..d3cb92e 100644
--- a/TalerWallet1/Views/Sheets/P2P_Sheets/P2pPayURIView.swift
+++ b/TalerWallet1/Views/Sheets/P2P_Sheets/P2pPayURIView.swift
@@ -37,15 +37,15 @@ struct P2pPayURIView: View {
.navigationTitle(navTitle)
NavigationLink(destination: LazyView {
- P2pAcceptDone(transactionId:
peerPullDebitResponse.transactionId)
+ P2pAcceptDone(transactionId:
peerPullDebitResponse.transactionId,
+ incoming: false)
}) {
Text("Confirm Payment", comment:"pay P2P invoice")
// SHEET_PAY_P2P
}.buttonStyle(TalerButtonStyle(type: .prominent))
.padding()
} else {
- // Yikes no details or no baseURL
- // WithdrawProgressView(message: url.host ??
badURL)
- // .navigationTitle("Contacting Exchange")
+ WithdrawProgressView(message: url.host ?? "Yikes - no valid
URL")
+ .navigationTitle("Contacting Exchange")
}
}
.onAppear() {
diff --git a/TalerWallet1/Views/Sheets/P2P_Sheets/P2pReceiveURIView.swift
b/TalerWallet1/Views/Sheets/P2P_Sheets/P2pReceiveURIView.swift
index f2c1f20..f40a5bf 100644
--- a/TalerWallet1/Views/Sheets/P2P_Sheets/P2pReceiveURIView.swift
+++ b/TalerWallet1/Views/Sheets/P2P_Sheets/P2pReceiveURIView.swift
@@ -38,7 +38,8 @@ struct P2pReceiveURIView: View {
let tosAccepted = true // TODO:
https://bugs.gnunet.org/view.php?id=7869
if tosAccepted {
NavigationLink(destination: LazyView {
- P2pAcceptDone(transactionId:
peerPushCreditResponse.transactionId)
+ P2pAcceptDone(transactionId:
peerPushCreditResponse.transactionId,
+ incoming: true)
}) {
Text("Accept Withdrawal") // SHEET_WITHDRAW_ACCEPT
}.buttonStyle(TalerButtonStyle(type: .prominent))
diff --git a/TalerWallet1/Views/Sheets/URLSheet.swift
b/TalerWallet1/Views/Sheets/URLSheet.swift
index d58eb4c..6902d55 100644
--- a/TalerWallet1/Views/Sheets/URLSheet.swift
+++ b/TalerWallet1/Views/Sheets/URLSheet.swift
@@ -7,7 +7,7 @@ import SymLog
struct URLSheet: View {
private let symLog = SymLogV()
- let navTitle = String(localized: "Invalid URL")
+ let navTitle = String(localized: "Examining URL")
var urlToOpen: URL
@EnvironmentObject private var controller: Controller
@@ -22,7 +22,7 @@ struct URLSheet: View {
case .pay:
PaymentURIView(url: urlToOpen)
case .payPull:
- Text("payPull not implemented yet")
+ P2pPayURIView(url: urlToOpen)
case .payPush:
P2pReceiveURIView(url: urlToOpen)
case .unknown:
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
- [taler-taler-ios] 09/54: Launch animation, SideBarView, (continued)
- [taler-taler-ios] 09/54: Launch animation, SideBarView, gnunet, 2023/06/30
- [taler-taler-ios] 01/54: Big update after DD37, gnunet, 2023/06/30
- [taler-taler-ios] 13/54: Overhaul withdraw + p2p, gnunet, 2023/06/30
- [taler-taler-ios] 17/54: for debugging time-outs, gnunet, 2023/06/30
- [taler-taler-ios] 10/54: Reduce Logging, gnunet, 2023/06/30
- [taler-taler-ios] 12/54: Localization, gnunet, 2023/06/30
- [taler-taler-ios] 08/54: Preparations for localization + accessability, gnunet, 2023/06/30
- [taler-taler-ios] 19/54: remove dismissFirst, gnunet, 2023/06/30
- [taler-taler-ios] 14/54: Made Model a Singleton, gnunet, 2023/06/30
- [taler-taler-ios] 40/54: TransactionType, gnunet, 2023/06/30
- [taler-taler-ios] 26/54: PeerPullDebit,
gnunet <=
- [taler-taler-ios] 16/54: Dummy, gnunet, 2023/06/30
- [taler-taler-ios] 34/54: sizeCategory, task, gnunet, 2023/06/30
- [taler-taler-ios] 06/54: Notifications, gnunet, 2023/06/30
- [taler-taler-ios] 42/54: BalanceRow, gnunet, 2023/06/30
- [taler-taler-ios] 15/54: Suspend-Resume, gnunet, 2023/06/30
- [taler-taler-ios] 21/54: Sounds, P2P receive, gnunet, 2023/06/30
- [taler-taler-ios] 07/54: Big Model update, removed unneccessary thread-safety code, gnunet, 2023/06/30
- [taler-taler-ios] 41/54: playSound, gnunet, 2023/06/30
- [taler-taler-ios] 30/54: bugfix, gnunet, 2023/06/30
- [taler-taler-ios] 43/54: confirmTransferUrl, gnunet, 2023/06/30