gnunet-svn
[Top][All Lists]
Advanced

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

[taler-taler-ios] 16/24: cleanup


From: gnunet
Subject: [taler-taler-ios] 16/24: cleanup
Date: Tue, 05 Dec 2023 16:26:12 +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 820d8b3f88d8eb07823a45dea6dbf9bf78feede7
Author: Marc Stibane <marc@taler.net>
AuthorDate: Mon Dec 4 09:47:25 2023 +0100

    cleanup
---
 TalerWallet1/Views/Peer2peer/RequestPayment.swift  | 38 ++++++++++------------
 TalerWallet1/Views/Peer2peer/SendAmount.swift      |  7 ++--
 .../WithdrawBankIntegrated/WithdrawTOSView.swift   |  6 ++--
 3 files changed, 25 insertions(+), 26 deletions(-)

diff --git a/TalerWallet1/Views/Peer2peer/RequestPayment.swift 
b/TalerWallet1/Views/Peer2peer/RequestPayment.swift
index a16f3c8..74205af 100644
--- a/TalerWallet1/Views/Peer2peer/RequestPayment.swift
+++ b/TalerWallet1/Views/Peer2peer/RequestPayment.swift
@@ -39,47 +39,45 @@ struct RequestPayment: View {
                             defaultValue: "Request \(amountStr)",
                                  comment: "NavTitle: Request 'amountStr'")
 
+        let someCoins = SomeCoins(details: peerPullCheck)
+        let p2pSubjectV = LazyView {
+            P2PSubjectV(stack: stack.push(),
+                 amountToSend: nil,
+              amountToReceive: amountToTransfer,
+                     navTitle: navTitle2,
+                  buttonTitle: buttonTitle,
+                     feeLabel: someCoins.feeLabel(currencyInfo),
+                 currencyInfo: currencyInfo,
+                      summary: $summary,
+                   expireDays: $expireDays)
+        }
         let _ = symLog.log("currency: \(currency)")
+        let disabled = amountToTransfer.isZero || someCoins.invalid || 
someCoins.tooMany
         ScrollView { VStack(alignment: .trailing) {
             CurrencyInputView(amount: $amountToTransfer,
                            available: nil,
                                title: iconOnly ? String(localized: "How much:")
                                                : String(localized: "Amount to 
request:"))
-            .padding(.top)
-            let someCoins = SomeCoins(details: peerPullCheck)
+                .padding(.top)
             QuiteSomeCoins(someCoins: someCoins,
                        shouldShowFee: true,     // always true since the 
requester pays fees
                             currency: currency,
                         currencyInfo: currencyInfo,
                      amountEffective: peerPullCheck?.amountEffective)
-
-            let disabled = amountToTransfer.isZero || someCoins.invalid || 
someCoins.tooMany
-
-            NavigationLink(destination: LazyView {
-                P2PSubjectV(stack: stack.push(),
-                     amountToSend: nil,
-                  amountToReceive: amountToTransfer,
-                         navTitle: navTitle2,
-                      buttonTitle: buttonTitle,
-                         feeLabel: someCoins.feeLabel(currencyInfo),
-                     currencyInfo: currencyInfo,
-                          summary: $summary,
-                       expireDays: $expireDays)
-            }) { Text("Next") }
+            NavigationLink(destination: p2pSubjectV) { Text("Next") }
                 .buttonStyle(TalerButtonStyle(type: .prominent))
                 .disabled(disabled)
-//            Spacer()
         } } // ScrollVStack
         .frame(maxWidth: .infinity, alignment: .leading)
-        .padding(.horizontal)
+        .padding(.horizontal)   // Lists do this automatically, but this is a 
VStack
         .background(WalletColors().backgroundColor.edgesIgnoringSafeArea(.all))
         .navigationTitle(navTitle)
         .onAppear {
             DebugViewC.shared.setViewID(VIEW_P2P_REQUEST, stack: stack.push())
-            symLog.log("❗️Yikes \(navTitle) onAppear")
+            symLog.log("❗️ \(navTitle) onAppear")
         }
         .onDisappear {
-            symLog.log("❗️Yikes \(navTitle) onDisappear")
+            symLog.log("❗️ \(navTitle) onDisappear")
         }
         .task(id: amountToTransfer.value) {
             if amountToTransfer.isZero {
diff --git a/TalerWallet1/Views/Peer2peer/SendAmount.swift 
b/TalerWallet1/Views/Peer2peer/SendAmount.swift
index b63da48..642d278 100644
--- a/TalerWallet1/Views/Peer2peer/SendAmount.swift
+++ b/TalerWallet1/Views/Peer2peer/SendAmount.swift
@@ -61,6 +61,7 @@ struct SendAmount: View {
         let insufficientLabel = String(localized: "You don't have enough 
\(currency).")
         let insufficientLabel2 = String(localized: "but you only have 
\(available) to send.")
 
+        let disabled = insufficient || amountToTransfer.isZero
         ScrollView { VStack(alignment: .trailing) {
 //          let _ = print("available: \(available)")
             Text("Available:\t\(available)")
@@ -70,13 +71,11 @@ struct SendAmount: View {
                            available: amountAvailable,
                                title: iconOnly ? String(localized: "How much:")
                                                : String(localized: "Amount to 
send:"))
-            let disabled = insufficient || amountToTransfer.isZero
             Text(insufficient ? insufficientLabel
                               : feeLabel)
                 .accessibilityFont(.body)
                 .foregroundColor(.red)
                 .padding(4)
-
             NavigationLink(destination: LazyView {
                 P2PSubjectV(stack: stack.push(),
                      amountToSend: amountToTransfer,
@@ -98,10 +97,10 @@ struct SendAmount: View {
         .navigationTitle(navTitle)
         .onAppear {
             DebugViewC.shared.setViewID(VIEW_P2P_SEND, stack: stack.push())
-            symLog.log("❗️Yikes SendAmount onAppear")
+            symLog.log("❗️ \(navTitle) onAppear")
         }
         .onDisappear {
-            symLog.log("❗️Yikes SendAmount onDisappear")
+            symLog.log("❗️ \(navTitle) onDisappear")
         }
         .task(id: amountToTransfer.value) {
             do {
diff --git 
a/TalerWallet1/Views/Sheets/WithdrawBankIntegrated/WithdrawTOSView.swift 
b/TalerWallet1/Views/Sheets/WithdrawBankIntegrated/WithdrawTOSView.swift
index dd80483..0eba89c 100644
--- a/TalerWallet1/Views/Sheets/WithdrawBankIntegrated/WithdrawTOSView.swift
+++ b/TalerWallet1/Views/Sheets/WithdrawBankIntegrated/WithdrawTOSView.swift
@@ -26,13 +26,15 @@ struct WithdrawTOSView: View {
             Content(symLog: symLog, exchangeTOS: exchangeTOS, myListStyle: 
$myListStyle) {
                 Task { // runs on MainActor
                     do {
-                        if let exchangeBaseUrl {
-                            _ = try await 
model.setExchangeTOSAcceptedM(exchangeBaseUrl, etag: exchangeTOS!.currentEtag)
+                        if let exchangeBaseUrl, let exchangeTOS {
+                            _ = try await 
model.setExchangeTOSAcceptedM(exchangeBaseUrl, etag: exchangeTOS.currentEtag)
                             if acceptAction != nil {
                                 acceptAction!()
                             } else { // just go back - caller will reload
                                 self.presentationMode.wrappedValue.dismiss()
                             }
+                        } else {
+                            // TODO: error
                         }
                     } catch {    // TODO: Show Error
                         symLog.log(error.localizedDescription)

-- 
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]