gnunet-svn
[Top][All Lists]
Advanced

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

[taler-taler-ios] 13/17: Fixes for error handling rebase


From: gnunet
Subject: [taler-taler-ios] 13/17: Fixes for error handling rebase
Date: Thu, 11 Apr 2024 23:13:45 +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 08a200e6c93f7e5bca497737cdebce76c2ca3e51
Author: Iván Ávalos <avalos@disroot.org>
AuthorDate: Thu Apr 11 11:11:58 2024 -0600

    Fixes for error handling rebase
---
 TalerWallet1/Controllers/Controller.swift         | 14 +++++---------
 TalerWallet1/Model/Model+Transactions.swift       |  2 +-
 TalerWallet1/Views/Sheets/WithdrawExchangeV.swift |  4 +---
 3 files changed, 7 insertions(+), 13 deletions(-)

diff --git a/TalerWallet1/Controllers/Controller.swift 
b/TalerWallet1/Controllers/Controller.swift
index 2045c8f..a3b79ee 100644
--- a/TalerWallet1/Controllers/Controller.swift
+++ b/TalerWallet1/Controllers/Controller.swift
@@ -89,17 +89,13 @@ class Controller: ObservableObject {
     @MainActor
     func getInfo(from exchangeBaseUrl: String, model: WalletModel) async 
throws -> CurrencyInfo? {
         let exchange = try await model.getExchangeByUrl(url: exchangeBaseUrl)
-        if let scopeInfo = exchange.scopeInfo {
-            if let info = hasInfo(for: scopeInfo.currency) {
-                return info
-            }
-            let info = try await model.getCurrencyInfoM(scope: scopeInfo, 
delay: 0)
-            await setInfo(info)
+        let scopeInfo = exchange.scopeInfo
+        if let info = hasInfo(for: scopeInfo.currency) {
             return info
-        } else {
-            // TODO: Error "Can't get Exchange Info"
         }
-        return nil
+        let info = try await model.getCurrencyInfoM(scope: scopeInfo, delay: 0)
+        await setInfo(info)
+        return info
     }
 
     @MainActor
diff --git a/TalerWallet1/Model/Model+Transactions.swift 
b/TalerWallet1/Model/Model+Transactions.swift
index 401c43a..c8d19df 100644
--- a/TalerWallet1/Model/Model+Transactions.swift
+++ b/TalerWallet1/Model/Model+Transactions.swift
@@ -104,7 +104,7 @@ struct ResumeTransaction: WalletBackendFormattedRequest {
 extension WalletModel {
     /// ask wallet-core for its list of transactions filtered by searchString
     func transactionsT(_ stack: CallStack, scopeInfo: ScopeInfo, searchString: 
String? = nil,
-                       sort: String = "descending", includeRefreshes: 
includeRefreshes, viewHandles: Bool = false)
+                       sort: String = "descending", includeRefreshes: Bool = 
false, viewHandles: Bool = false)
     async throws -> [Transaction] {
         let request = GetTransactions(scopeInfo: scopeInfo, currency: 
scopeInfo.currency, search: searchString, sort: sort, includeRefreshes: 
includeRefreshes)
         let response = try await sendRequest(request, ASYNCDELAY, viewHandles: 
viewHandles)
diff --git a/TalerWallet1/Views/Sheets/WithdrawExchangeV.swift 
b/TalerWallet1/Views/Sheets/WithdrawExchangeV.swift
index fd1a9df..8968849 100644
--- a/TalerWallet1/Views/Sheets/WithdrawExchangeV.swift
+++ b/TalerWallet1/Views/Sheets/WithdrawExchangeV.swift
@@ -50,9 +50,7 @@ struct WithdrawExchangeV: View {
                         if let amount = withdrawExchange.amount {
                             amountToTransfer = amount
                         } else {
-                            let currency = exc.scopeInfo?.currency
-                            ?? exc.currency
-                            ?? String(localized: "Unknown", comment: "unknown 
currency")
+                            let currency = exc.scopeInfo.currency
                             amountToTransfer.setCurrency(currency)
                             // is already Amount.zero(currency: "")
                         }

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