[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.
- [taler-taler-ios] branch master updated (c38068b -> 6b94fe0), gnunet, 2024/04/11
- [taler-taler-ios] 02/17: Bump version to 0.9.6 (1), gnunet, 2024/04/11
- [taler-taler-ios] 03/17: updateExchangeEntry (temporarily) back to exchangeBaseUrl (instead of scopeInfo), gnunet, 2024/04/11
- [taler-taler-ios] 06/17: clientCancellationId, gnunet, 2024/04/11
- [taler-taler-ios] 07/17: Laying the foundations of improved error handling, gnunet, 2024/04/11
- [taler-taler-ios] 04/17: emitObservabilityEvents, gnunet, 2024/04/11
- [taler-taler-ios] 05/17: symLog after quickjs.sendMessage returned, gnunet, 2024/04/11
- [taler-taler-ios] 01/17: rename setConfig, gnunet, 2024/04/11
- [taler-taler-ios] 11/17: Prepare notification error handling, gnunet, 2024/04/11
- [taler-taler-ios] 13/17: Fixes for error handling rebase,
gnunet <=
- [taler-taler-ios] 09/17: Implement error handling all around (+refactoring), gnunet, 2024/04/11
- [taler-taler-ios] 08/17: Improve errors and move them to WalletModel, gnunet, 2024/04/11
- [taler-taler-ios] 15/17: cleanup, gnunet, 2024/04/11
- [taler-taler-ios] 14/17: catch WalletBackendError.walletCoreError, gnunet, 2024/04/11
- [taler-taler-ios] 16/17: error handling, logging, gnunet, 2024/04/11
- [taler-taler-ios] 17/17: Bump version to 0.9.7 (1), gnunet, 2024/04/11
- [taler-taler-ios] 12/17: Centralize all error handling in the model, gnunet, 2024/04/11
- [taler-taler-ios] 10/17: Improvements to error dialog, gnunet, 2024/04/11