commit d643b533319b56dcc01e84bd023397dcfd50c5e7
parent 8f1a2162b0f758d2de40331f23c7a9a8872a473a
Author: Marc Stibane <marc@taler.net>
Date: Wed, 5 Mar 2025 08:07:55 +0100
returning Exchange
Diffstat:
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/TalerWallet1/Controllers/Controller.swift b/TalerWallet1/Controllers/Controller.swift
@@ -209,16 +209,18 @@ class Controller: ObservableObject {
}
}
- func checkCurrencyInfo(for baseUrl: String, model: WalletModel) async {
+ func checkCurrencyInfo(for baseUrl: String, model: WalletModel) async -> Exchange? {
if let exchange = await exchange(for: baseUrl, model: model) {
let scope = exchange.scopeInfo
if currencyInfos[scope] == nil {
logger.log(" ❗️got no info for \(baseUrl.trimURL) \(scope.currency) -> will update")
await updateInfo(scope, model: model)
}
+ return exchange
} else {
// Yikes❗️ TODO: error?
}
+ return nil
}
/// called whenever a new currency pops up - will first load the Exchange and then currencyInfos