gnunet-svn
[Top][All Lists]
Advanced

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

[taler-taler-ios] 51/69: cleanup


From: gnunet
Subject: [taler-taler-ios] 51/69: cleanup
Date: Fri, 19 Jan 2024 09:02:24 +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 f5d399ef4239c5be20f7c9bb8d1ec8d1d14e87d8
Author: Marc Stibane <marc@taler.net>
AuthorDate: Thu Jan 18 00:13:20 2024 +0100

    cleanup
---
 TalerWallet1/Controllers/TalerWallet1App.swift                |  2 +-
 TalerWallet1/Quickjs/quickjs.swift                            | 11 ++++++-----
 TalerWallet1/Views/Banking/ManualWithdrawDone.swift           |  5 ++++-
 TalerWallet1/Views/Main/MainView.swift                        |  3 ---
 TalerWallet1/Views/Sheets/P2P_Sheets/P2pAcceptDone.swift      |  7 +++++--
 .../Sheets/WithdrawBankIntegrated/WithdrawAcceptDone.swift    |  5 ++++-
 TalerWallet1/Views/Transactions/TransactionDetailView.swift   |  6 +++---
 7 files changed, 23 insertions(+), 16 deletions(-)

diff --git a/TalerWallet1/Controllers/TalerWallet1App.swift 
b/TalerWallet1/Controllers/TalerWallet1App.swift
index 043d646..694e05c 100644
--- a/TalerWallet1/Controllers/TalerWallet1App.swift
+++ b/TalerWallet1/Controllers/TalerWallet1App.swift
@@ -104,7 +104,7 @@ final class ViewState : ObservableObject {
     @Published var rootViewId = UUID()
     let logger = Logger(subsystem: "net.taler.gnu", category: "ViewState")
 
-    public func popToRootView() -> Void {
+    public func popToRootView(_ stack: CallStack) -> Void {
         logger.info("popToRootView")
         rootViewId = UUID() // setting a new ID will cause tableView 
popToRootView behaviour
     }
diff --git a/TalerWallet1/Quickjs/quickjs.swift 
b/TalerWallet1/Quickjs/quickjs.swift
index 54f42bd..89728ac 100644
--- a/TalerWallet1/Quickjs/quickjs.swift
+++ b/TalerWallet1/Quickjs/quickjs.swift
@@ -23,20 +23,21 @@ func logging_callback(userdata: 
Optional<UnsafeMutableRawPointer>,
                             tag: Optional<UnsafePointer<Int8>>,
                         message: Optional<UnsafePointer<Int8>>) {
     let native = Unmanaged<Quickjs>.fromOpaque(userdata!).takeUnretainedValue()
+    let logger = native.logger
     let theTag = String(cString: tag!)
     let theMessage = String(cString: message!)
 
     switch level {
         case TALER_WALLET_LOG_ERROR:
-            native.logger.error("\(theTag, privacy: .public)  \(theMessage, 
privacy: .public)")
+            logger.error("\(theTag, privacy: .public)  \(theMessage, privacy: 
.public)")
         case TALER_WALLET_LOG_WARN:
-            native.logger.warning("\(theTag, privacy: .public)  \(theMessage, 
privacy: .public)")
+            logger.warning("\(theTag, privacy: .public)  \(theMessage, 
privacy: .public)")
         case TALER_WALLET_LOG_MESSAGE:
-            native.logger.notice("\(theTag, privacy: .public)  \(theMessage, 
privacy: .public)")
+            logger.notice("\(theTag, privacy: .public)  \(theMessage, privacy: 
.public)")
         case TALER_WALLET_LOG_INFO:
-            native.logger.info("\(theTag, privacy: .public)  \(theMessage, 
privacy: .public)")
+            logger.info("\(theTag, privacy: .public)  \(theMessage, privacy: 
.public)")
         case TALER_WALLET_LOG_TRACE:
-            native.logger.trace("\(theTag, privacy: .public)  \(theMessage, 
privacy: .public)")
+            logger.trace("\(theTag, privacy: .public)  \(theMessage, privacy: 
.public)")
         default: break
     }
 }
diff --git a/TalerWallet1/Views/Banking/ManualWithdrawDone.swift 
b/TalerWallet1/Views/Banking/ManualWithdrawDone.swift
index 8a855a6..d9ecd26 100644
--- a/TalerWallet1/Views/Banking/ManualWithdrawDone.swift
+++ b/TalerWallet1/Views/Banking/ManualWithdrawDone.swift
@@ -23,6 +23,9 @@ struct ManualWithdrawDone: View {
     func reloadOneAction(_ transactionId: String) async throws -> Transaction {
         return try await model.getTransactionByIdT(transactionId)
     }
+    func dismissTopAnimated(_ stack: CallStack) {
+        dismissTop()
+    }
 
     var body: some View {
 #if PRINT_CHANGES
@@ -35,7 +38,7 @@ struct ManualWithdrawDone: View {
                               transactionId: transactionId,
                                reloadAction: reloadOneAction,
                                    navTitle: navTitle,
-                                 doneAction: ViewState.shared.popToRootView,
+                                 doneAction: dismissTopAnimated,    // 
ViewState.shared.popToRootView,
                                 abortAction: nil,
                                deleteAction: nil,
                                  failAction: nil,
diff --git a/TalerWallet1/Views/Main/MainView.swift 
b/TalerWallet1/Views/Main/MainView.swift
index 78c0032..ce54497 100644
--- a/TalerWallet1/Views/Main/MainView.swift
+++ b/TalerWallet1/Views/Main/MainView.swift
@@ -221,13 +221,10 @@ extension MainView {
             .onChange(of: balances) { newArray in
                 for balance in newArray {
                     let scope = balance.scopeInfo
-                    logger.info("balance changed: \(scope.currency, privacy: 
.public)")
                     if controller.hasInfo(for: scope.currency) == nil {
                         Task { // runs on MainActor
-//                            logger.info("Task to get info for: 
\(scope.currency, privacy: .public)")
                             do {
                                 let info = try await 
model.getCurrencyInfoM(scope: scope, delay: delay)
-//                                logger.info("got info: \(scope.currency, 
privacy: .public)")
                                 await controller.setInfo(info)
                             } catch {    // TODO: error handling - couldn't 
get CurrencyInfo
                                 logger.error("Couldn't get info for: 
\(scope.currency, privacy: .public)\n\(error)")
diff --git a/TalerWallet1/Views/Sheets/P2P_Sheets/P2pAcceptDone.swift 
b/TalerWallet1/Views/Sheets/P2P_Sheets/P2pAcceptDone.swift
index 7bb6832..51cd0d4 100644
--- a/TalerWallet1/Views/Sheets/P2P_Sheets/P2pAcceptDone.swift
+++ b/TalerWallet1/Views/Sheets/P2P_Sheets/P2pAcceptDone.swift
@@ -22,7 +22,10 @@ struct P2pAcceptDone: View {
     func reloadOneAction(_ transactionId: String) async throws -> Transaction {
         return try await model.getTransactionByIdT(transactionId)
     }
-
+    func dismissTopAnimated(_ stack: CallStack) {
+        dismissTop()
+    }
+    
     var body: some View {
 #if PRINT_CHANGES
         let _ = Self._printChanges()
@@ -34,7 +37,7 @@ struct P2pAcceptDone: View {
                       transactionId: transactionId,
                        reloadAction: reloadOneAction,
                            navTitle: navTitle,
-                         doneAction: { dismissTop() },
+                         doneAction: dismissTopAnimated,
                         abortAction: nil,
                        deleteAction: nil,
                          failAction: nil,
diff --git 
a/TalerWallet1/Views/Sheets/WithdrawBankIntegrated/WithdrawAcceptDone.swift 
b/TalerWallet1/Views/Sheets/WithdrawBankIntegrated/WithdrawAcceptDone.swift
index 3e9a337..a15ebd3 100644
--- a/TalerWallet1/Views/Sheets/WithdrawBankIntegrated/WithdrawAcceptDone.swift
+++ b/TalerWallet1/Views/Sheets/WithdrawBankIntegrated/WithdrawAcceptDone.swift
@@ -22,6 +22,9 @@ struct WithdrawAcceptDone: View {
     func reloadOneAction(_ transactionId: String) async throws -> Transaction {
             return try await model.getTransactionByIdT(transactionId)
     }
+    func dismissTopAnimated(_ stack: CallStack) {
+        dismissTop()
+    }
 
     var body: some View {
 #if PRINT_CHANGES
@@ -34,7 +37,7 @@ struct WithdrawAcceptDone: View {
                               transactionId: transactionId,
                                reloadAction: reloadOneAction,
                                    navTitle: navTitle,
-                                 doneAction: { dismissTop() },
+                                 doneAction: dismissTopAnimated,
                                 abortAction: nil,
                                deleteAction: nil,
                                  failAction: nil,
diff --git a/TalerWallet1/Views/Transactions/TransactionDetailView.swift 
b/TalerWallet1/Views/Transactions/TransactionDetailView.swift
index a7b93c9..4bd1ef8 100644
--- a/TalerWallet1/Views/Transactions/TransactionDetailView.swift
+++ b/TalerWallet1/Views/Transactions/TransactionDetailView.swift
@@ -27,7 +27,7 @@ struct TransactionDetailView: View {
     let transactionId: String
     let reloadAction: ((_ transactionId: String) async throws -> Transaction)
     let navTitle: String?
-    let doneAction: (() -> Void)?
+    let doneAction: ((_ stack: CallStack) -> Void)?
     let abortAction: ((_ transactionId: String) async throws -> Void)?
     let deleteAction: ((_ transactionId: String) async throws -> Void)?
     let failAction: ((_ transactionId: String) async throws -> Void)?
@@ -71,7 +71,7 @@ struct TransactionDetailView: View {
             if let transition = notification.userInfo?[TRANSACTIONTRANSITION] 
as? TransactionTransition {
                 if transition.transactionId == 
transaction.common.transactionId {       // is the transition for THIS 
transaction?
                     symLog.log(logStr)
-                    doneAction()        // if this view is in a sheet then 
dissmiss the sheet
+                    doneAction(stack.push())        // if this view is in a 
sheet then dissmiss the sheet
                     return true
                 }
             }
@@ -160,7 +160,7 @@ struct TransactionDetailView: View {
                                       action: deleteAction)
                 } } // Delete button
                 if let doneAction {
-                    Button(transaction.shouldConfirm ? "Confirm later" : 
"Done", action: doneAction)
+                    Button(transaction.shouldConfirm ? "Confirm later" : 
"Done", action: { doneAction(stack.push()) } )
                         .buttonStyle(TalerButtonStyle(type: 
transaction.shouldConfirm ? .bordered : .prominent))
                 } // Done button
             }.id(viewId)    // change viewId to enforce a draw update

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