gnunet-svn
[Top][All Lists]
Advanced

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

[taler-taler-ios] 12/204: cleanup project


From: gnunet
Subject: [taler-taler-ios] 12/204: cleanup project
Date: Thu, 05 Dec 2024 23:49:40 +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 4f50ba3a4a431cafe51d2ca091ccc866f7444e6b
Author: Marc Stibane <marc@taler.net>
AuthorDate: Fri Sep 13 09:11:00 2024 +0200

    cleanup project
---
 TalerWallet.xcodeproj/project.pbxproj              |  2 +-
 .../Views/{ => Actions}/Peer2peer/P2PReadyV.swift  |  0
 .../{ => Actions}/Peer2peer/P2PSubjectV.swift      |  3 ++
 .../{ => Actions}/Peer2peer/RequestPayment.swift   |  3 +-
 .../Views/{ => Actions}/Peer2peer/SendAmount.swift | 34 +++++++++++++++++-----
 5 files changed, 33 insertions(+), 9 deletions(-)

diff --git a/TalerWallet.xcodeproj/project.pbxproj 
b/TalerWallet.xcodeproj/project.pbxproj
index 909092f..c94231e 100644
--- a/TalerWallet.xcodeproj/project.pbxproj
+++ b/TalerWallet.xcodeproj/project.pbxproj
@@ -748,7 +748,6 @@
                                4EB0952E2989CBFE0043A8A1 /* Transactions */,
                                4EB095272989CBFE0043A8A1 /* Banking */,
                                4EB095242989CBFE0043A8A1 /* Settings */,
-                               4ECB627E2A0BA4DA004ABBB7 /* Peer2peer */,
                                4EEC157129F7188B00D46A03 /* Sheets */,
                                4EB095462989CBFE0043A8A1 /* HelperViews */,
                        );
@@ -889,6 +888,7 @@
                        children = (
                                4E2B337C2C8B1D5500186A3E /* ActionsSheet.swift 
*/,
                                4EB095362989CBFE0043A8A1 /* SendRequestV.swift 
*/,
+                               4ECB627E2A0BA4DA004ABBB7 /* Peer2peer */,
                                4EA076B22BC0607400685A10 /* 
DepositWithdrawV.swift */,
                        );
                        path = Actions;
diff --git a/TalerWallet1/Views/Peer2peer/P2PReadyV.swift 
b/TalerWallet1/Views/Actions/Peer2peer/P2PReadyV.swift
similarity index 100%
rename from TalerWallet1/Views/Peer2peer/P2PReadyV.swift
rename to TalerWallet1/Views/Actions/Peer2peer/P2PReadyV.swift
diff --git a/TalerWallet1/Views/Peer2peer/P2PSubjectV.swift 
b/TalerWallet1/Views/Actions/Peer2peer/P2PSubjectV.swift
similarity index 98%
rename from TalerWallet1/Views/Peer2peer/P2PSubjectV.swift
rename to TalerWallet1/Views/Actions/Peer2peer/P2PSubjectV.swift
index fac3817..1362d04 100644
--- a/TalerWallet1/Views/Peer2peer/P2PSubjectV.swift
+++ b/TalerWallet1/Views/Actions/Peer2peer/P2PSubjectV.swift
@@ -145,6 +145,9 @@ struct P2PSubjectV: View {
                         let feeStr = feeAmount.formatted(currencyInfo, 
isNegative: false)
                         myFeeLabel = String(localized: "+ \(feeStr) fee")
                     } else { myFeeLabel = EMPTYSTRING }
+                } else {
+                    print("❗️ checkPeerPushDebitM failed")
+
                 }
             }
         }
diff --git a/TalerWallet1/Views/Peer2peer/RequestPayment.swift 
b/TalerWallet1/Views/Actions/Peer2peer/RequestPayment.swift
similarity index 99%
rename from TalerWallet1/Views/Peer2peer/RequestPayment.swift
rename to TalerWallet1/Views/Actions/Peer2peer/RequestPayment.swift
index 4560e55..bc42778 100644
--- a/TalerWallet1/Views/Peer2peer/RequestPayment.swift
+++ b/TalerWallet1/Views/Actions/Peer2peer/RequestPayment.swift
@@ -10,7 +10,8 @@ import SymLog
 struct RequestPayment: View {
     private let symLog = SymLogV(0)
     let stack: CallStack
-//    @Binding var currencyInfo: CurrencyInfo
+    let balances: [Balance]
+    @Binding var selectedBalance: Balance?
 
     @Binding var amountToTransfer: Amount
     @Binding var summary: String
diff --git a/TalerWallet1/Views/Peer2peer/SendAmount.swift 
b/TalerWallet1/Views/Actions/Peer2peer/SendAmount.swift
similarity index 91%
rename from TalerWallet1/Views/Peer2peer/SendAmount.swift
rename to TalerWallet1/Views/Actions/Peer2peer/SendAmount.swift
index fd6b8d7..4614c30 100644
--- a/TalerWallet1/Views/Peer2peer/SendAmount.swift
+++ b/TalerWallet1/Views/Actions/Peer2peer/SendAmount.swift
@@ -14,12 +14,14 @@ struct SendAmount: View {
     private let symLog = SymLogV(0)
     let stack: CallStack
     let balances: [Balance]
-    let available: Amount?
+    @Binding var selectedBalance: Balance?
     @Binding var amountToTransfer: Amount
     @Binding var summary: String
     let scopeInfo: ScopeInfo
     let cameraAction: () -> Void
 
+    // TODO: call getMaxPeerPushDebitAmountM
+
     @EnvironmentObject private var controller: Controller
     @EnvironmentObject private var model: WalletModel
     @Environment(\.colorScheme) private var colorScheme
@@ -100,7 +102,18 @@ struct SendAmount: View {
             }
         } catch {
             // handle cancel, errors
-            symLog.log("❗️ \(error)")
+            symLog.log("❗️ \(error), \(error.localizedDescription)")
+            switch error {
+                case let walletError as WalletBackendError:
+                    switch walletError {
+                        case .walletCoreError(let wError): 
+                            if wError?.code == 7027 {
+                                return ComputeFeeResult.insufficient()
+                            }
+                        default: break
+                    }
+                default: break
+            }
         }
         return nil
     }
@@ -146,7 +159,7 @@ struct SendAmount: View {
                    expireDays: $expireDays)
         }
 
-        ScrollView {
+        let sendAmountView = ScrollView {
             ScopePicker(stack: stack.push(), balances: nonZeroBalances, 
selected: $balanceIndex)
 
             let amountLabel = minimalistic ? String(localized: "Amount:")
@@ -179,7 +192,7 @@ struct SendAmount: View {
                                                                         scope: 
scopeInfo, viewHandles: true)
                 amountAvailable = amount
             } catch {
-                amountAvailable = available ?? Amount.zero(currency: 
amountToTransfer.currencyStr)
+                amountAvailable = Amount.zero(currency: 
amountToTransfer.currencyStr)
             }
         }
         .onAppear {
@@ -191,7 +204,7 @@ struct SendAmount: View {
             symLog.log("❗️ \(navTitle) onDisappear")
         }
         .navigationBarItems(trailing: QRButton(action: cameraAction))
-        .task(id: balanceIndex + (10 * controller.currencyTicker)) {
+        .task(id: balanceIndex + (1000 * controller.currencyTicker)) {
             let balance = nonZeroBalances[index]
             let scopeInfo = balance.scopeInfo
             let currency = scopeInfo.currency
@@ -236,6 +249,13 @@ struct SendAmount: View {
 //                }
 //            }
 //        }
+
+        if #available(iOS 16.0, *) {
+            sendAmountView.toolbar(.hidden, for: .tabBar)
+        } else {
+            sendAmountView
+        }
+
     }
 }
 // MARK: -
@@ -244,6 +264,7 @@ fileprivate struct Preview_Content: View {
     @State private var amountToPreview = Amount(currency: DEMOCURRENCY, cent: 
510)
     @State private var summary: String = ""
     @State private var currencyInfoL: CurrencyInfo = 
CurrencyInfo.zero(DEMOCURRENCY)
+    @State private var selectedBalance: Balance? = nil
 
     private func checkCameraAvailable() -> Void {
         // Open Camera when QR-Button was tapped
@@ -268,8 +289,7 @@ fileprivate struct Preview_Content: View {
                                   flags: [])
         SendAmount(stack: CallStack("Preview"),
                 balances: [balance],
-//            currencyInfo: $currencyInfoL,
-               available: amount,
+         selectedBalance: $selectedBalance,
         amountToTransfer: $amountToPreview,
                  summary: $summary,
                scopeInfo: currencyInfo.scope,

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