gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-taler-ios] 18/69: ToS for P2P


From: gnunet
Subject: [taler-taler-ios] 18/69: ToS for P2P
Date: Fri, 19 Jan 2024 09:01:51 +0100

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 7dea9e491354de52ccb8b2b9c2222d77abaa3b88
Author: Marc Stibane <marc@taler.net>
AuthorDate: Wed Jan 3 17:47:07 2024 +0100

    ToS for P2P
---
 TalerWallet1/Views/Exchange/ManualWithdraw.swift   | 27 +++++++++++-----------
 .../Sheets/P2P_Sheets/P2pReceiveURIView.swift      | 14 +++++------
 .../WithdrawBankIntegrated/WithdrawURIView.swift   | 14 ++++++-----
 3 files changed, 29 insertions(+), 26 deletions(-)

diff --git a/TalerWallet1/Views/Exchange/ManualWithdraw.swift 
b/TalerWallet1/Views/Exchange/ManualWithdraw.swift
index 6e96795..fce67f7 100644
--- a/TalerWallet1/Views/Exchange/ManualWithdraw.swift
+++ b/TalerWallet1/Views/Exchange/ManualWithdraw.swift
@@ -48,23 +48,24 @@ struct ManualWithdraw: View {
 //                           restrictAge: restrictAge)
             }
             let disabled = amountToTransfer.isZero || someCoins.invalid || 
someCoins.tooMany
+            let tosAccepted = exchange.tosStatus == .accepted
             ScrollView { VStack(alignment: .trailing) {
                 Text("via \(exchange.exchangeBaseUrl.trimURL())")
                     .multilineTextAlignment(.center)
                     .accessibilityFont(.body)
-                CurrencyInputView(amount: $amountToTransfer,
-                               available: nil,
-                                   title: iconOnly ? String(localized: 
"Amount:")
-                                                   : String(localized: "Amount 
to withdraw:"),
-                          shortcutAction: nil)
-                    .padding(.top)
-                QuiteSomeCoins(someCoins: someCoins,
-                           shouldShowFee: true,           // TODO: set to 
false if we never charge withdrawal fees
-                                currency: currency,
-                            currencyInfo: currencyInfo,
-                         amountEffective: 
withdrawalAmountDetails?.amountEffective)
-//              agePicker
-                if exchange.tosStatus == .accepted {
+                if !tosAccepted {
+                    CurrencyInputView(amount: $amountToTransfer,
+                                   available: nil,
+                                       title: iconOnly ? String(localized: 
"Amount:")
+                                                       : String(localized: 
"Amount to withdraw:"),
+                              shortcutAction: nil)
+                        .padding(.top)
+                    QuiteSomeCoins(someCoins: someCoins,
+                               shouldShowFee: true,           // TODO: set to 
false if we never charge withdrawal fees
+                                    currency: currency,
+                                currencyInfo: currencyInfo,
+                             amountEffective: 
withdrawalAmountDetails?.amountEffective)
+//                  agePicker
                     NavigationLink(destination: destination) {
                         Text("Confirm Withdrawal")      // VIEW_WITHDRAW_ACCEPT
                     }
diff --git a/TalerWallet1/Views/Sheets/P2P_Sheets/P2pReceiveURIView.swift 
b/TalerWallet1/Views/Sheets/P2P_Sheets/P2pReceiveURIView.swift
index 0f71b3e..5e97857 100644
--- a/TalerWallet1/Views/Sheets/P2P_Sheets/P2pReceiveURIView.swift
+++ b/TalerWallet1/Views/Sheets/P2P_Sheets/P2pReceiveURIView.swift
@@ -23,9 +23,15 @@ struct P2pReceiveURIView: View {
     @State private var exchange: Exchange? = nil
 
     var body: some View {
-        let badURL = "Error in URL: \(url)"
         VStack {
             if let peerPushCreditResponse {
+                let tosAccepted = exchange?.tosStatus == .accepted
+                if !tosAccepted {
+                    ToSButtonView(stack: stack.push(),
+                        exchangeBaseUrl: 
peerPushCreditResponse.exchangeBaseUrl,
+                                 viewID: SHEET_RCV_P2P_TOS,
+                                    p2p: true)
+                }
                 List {
                     let raw = peerPushCreditResponse.amountRaw
                     let effective = peerPushCreditResponse.amountEffective
@@ -44,7 +50,6 @@ struct P2pReceiveURIView: View {
                 }
                 .listStyle(myListStyle.style).anyView
                 .navigationTitle(navTitle)
-                let tosAccepted = exchange?.tosStatus == .accepted
                 if tosAccepted {
                     NavigationLink(destination: LazyView {
                         P2pAcceptDone(stack: stack.push(),
@@ -55,11 +60,6 @@ struct P2pReceiveURIView: View {
                     }
                     .buttonStyle(TalerButtonStyle(type: .prominent))
                     .padding(.horizontal)
-                } else {
-                    ToSButtonView(stack: stack.push(),
-                        exchangeBaseUrl: 
peerPushCreditResponse.exchangeBaseUrl,
-                                 viewID: SHEET_RCV_P2P_TOS,
-                                    p2p: true)
                 }
             } else {
                 LoadingView(url: url, message: nil)
diff --git 
a/TalerWallet1/Views/Sheets/WithdrawBankIntegrated/WithdrawURIView.swift 
b/TalerWallet1/Views/Sheets/WithdrawBankIntegrated/WithdrawURIView.swift
index 5c9ec65..284d94d 100644
--- a/TalerWallet1/Views/Sheets/WithdrawBankIntegrated/WithdrawURIView.swift
+++ b/TalerWallet1/Views/Sheets/WithdrawBankIntegrated/WithdrawURIView.swift
@@ -27,6 +27,13 @@ struct WithdrawURIView: View {
     var body: some View {
         VStack {
             if let withdrawalAmountDetails, let exchange {
+                let tosAccepted = exchange.tosStatus == .accepted
+                if !tosAccepted {
+                    ToSButtonView(stack: stack.push(),
+                        exchangeBaseUrl: exchange.exchangeBaseUrl,
+                                 viewID: SHEET_WITHDRAW_TOS,
+                                    p2p: false)
+                }
                 List {
                     let raw = withdrawalAmountDetails.amountRaw
                     let effective = withdrawalAmountDetails.amountEffective
@@ -55,7 +62,7 @@ struct WithdrawURIView: View {
                 }
                 .listStyle(myListStyle.style).anyView
                 .navigationTitle(navTitle)
-                if exchange.tosStatus == .accepted {
+                if tosAccepted {
                     NavigationLink(destination: LazyView {
                         WithdrawAcceptDone(stack: stack.push(),
                                  exchangeBaseUrl: exchange.exchangeBaseUrl,
@@ -65,11 +72,6 @@ struct WithdrawURIView: View {
                     }
                     .buttonStyle(TalerButtonStyle(type: .prominent))
                     .padding(.horizontal)
-                } else {
-                    ToSButtonView(stack: stack.push(),
-                        exchangeBaseUrl: exchange.exchangeBaseUrl,
-                                 viewID: SHEET_WITHDRAW_TOS,
-                                    p2p: false)
                 }
             } else {        // no details or no exchange
                 LoadingView(url: url, message: nil)

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]