gnunet-svn
[Top][All Lists]
Advanced

[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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]