[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-taler-ios] 109/204: loadBalances
From: |
gnunet |
Subject: |
[taler-taler-ios] 109/204: loadBalances |
Date: |
Thu, 05 Dec 2024 23:51:17 +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 8f593bdffa8585741184b2626d883f66c369af94
Author: Marc Stibane <marc@taler.net>
AuthorDate: Fri Nov 8 17:27:36 2024 +0100
loadBalances
---
TalerWallet1/Controllers/Controller.swift | 4 ++--
TalerWallet1/Model/Model+Balances.swift | 5 +----
2 files changed, 3 insertions(+), 6 deletions(-)
diff --git a/TalerWallet1/Controllers/Controller.swift
b/TalerWallet1/Controllers/Controller.swift
index 3e78caf..e64c71d 100755
--- a/TalerWallet1/Controllers/Controller.swift
+++ b/TalerWallet1/Controllers/Controller.swift
@@ -117,10 +117,10 @@ class Controller: ObservableObject {
// checkInternetConnection()
}
// MARK: -
- /// runs on MainActor if called in some Task {}
+ @MainActor
@discardableResult
func loadBalances(_ stack: CallStack,_ model: WalletModel) async -> Int? {
- if let reloaded = try? await model.balancesM(stack.push()) {
+ if let reloaded = try? await model.getBalances(stack.push()) {
for balance in reloaded {
let scope = balance.scopeInfo
checkInfo(for: scope, model: model)
diff --git a/TalerWallet1/Model/Model+Balances.swift
b/TalerWallet1/Model/Model+Balances.swift
index 42beaf7..fd3a4c1 100644
--- a/TalerWallet1/Model/Model+Balances.swift
+++ b/TalerWallet1/Model/Model+Balances.swift
@@ -69,10 +69,7 @@ fileprivate struct Balances: WalletBackendFormattedRequest {
// MARK: -
extension WalletModel {
/// fetch Balances from Wallet-Core. No networking involved
- @MainActor func balancesM(_ stack: CallStack, viewHandles: Bool = false)
- async throws -> [Balance] { // M for MainActor
- await semaphore.wait()
- defer { semaphore.signal() }
+ nonisolated func getBalances(_ stack: CallStack, viewHandles: Bool =
false) async throws -> [Balance] {
let request = Balances()
let response = try await sendRequest(request, ASYNCDELAY, viewHandles:
viewHandles)
return response.balances
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
- [taler-taler-ios] 94/204: wording, (continued)
- [taler-taler-ios] 94/204: wording, gnunet, 2024/12/05
- [taler-taler-ios] 98/204: - LazyView, gnunet, 2024/12/05
- [taler-taler-ios] 95/204: - proposalId, gnunet, 2024/12/05
- [taler-taler-ios] 99/204: wording, gnunet, 2024/12/05
- [taler-taler-ios] 97/204: TransactionCommon, row, gnunet, 2024/12/05
- [taler-taler-ios] 101/204: CheckDepositResponse, gnunet, 2024/12/05
- [taler-taler-ios] 104/204: split, gnunet, 2024/12/05
- [taler-taler-ios] 107/204: debug, fix wrong comparison, gnunet, 2024/12/05
- [taler-taler-ios] 102/204: task viewDidLoad, gnunet, 2024/12/05
- [taler-taler-ios] 105/204: NavLink, gnunet, 2024/12/05
- [taler-taler-ios] 109/204: loadBalances,
gnunet <=
- [taler-taler-ios] 106/204: Use NavLink, gnunet, 2024/12/05
- [taler-taler-ios] 113/204: PendingOperations (unused), gnunet, 2024/12/05
- [taler-taler-ios] 114/204: Pay, gnunet, 2024/12/05
- [taler-taler-ios] 110/204: deposit, gnunet, 2024/12/05
- [taler-taler-ios] 122/204: Yellow for confirm, gnunet, 2024/12/05
- [taler-taler-ios] 119/204: cleanup, gnunet, 2024/12/05
- [taler-taler-ios] 120/204: Withdraw, gnunet, 2024/12/05
- [taler-taler-ios] 116/204: Settings, gnunet, 2024/12/05
- [taler-taler-ios] 112/204: P2P, gnunet, 2024/12/05
- [taler-taler-ios] 121/204: TransactionById, gnunet, 2024/12/05