gnunet-svn
[Top][All Lists]
Advanced

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

[taler-taler-ios] 03/05: reload Balances


From: gnunet
Subject: [taler-taler-ios] 03/05: reload Balances
Date: Tue, 04 Jul 2023 17:06:15 +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 29e3b6ed68b40860c42f3904565241a742105796
Author: Marc Stibane <marc@taler.net>
AuthorDate: Tue Jul 4 16:26:15 2023 +0200

    reload Balances
---
 TalerWallet1/Views/Balances/BalancesListView.swift | 18 ++++++------------
 1 file changed, 6 insertions(+), 12 deletions(-)

diff --git a/TalerWallet1/Views/Balances/BalancesListView.swift 
b/TalerWallet1/Views/Balances/BalancesListView.swift
index 2628bd3..790c4ee 100644
--- a/TalerWallet1/Views/Balances/BalancesListView.swift
+++ b/TalerWallet1/Views/Balances/BalancesListView.swift
@@ -131,7 +131,6 @@ extension BalancesListView {
         @Binding var summary: String
         var reloadAction: () async -> Int
 
-        @State private var shouldLoad = false
         var body: some View {
 #if DEBUG
             let _ = Self._printChanges()
@@ -153,18 +152,13 @@ extension BalancesListView {
                 }
                 .listStyle(myListStyle.style).anyView
             }
-            .onAppear {
-                if shouldLoad {
-                    shouldLoad = false
-                    symLog?.log(".onAppear: shouldLoad ==> reloading balances")
-                    Task { await reloadAction() }
-                }
-            }
-            // automatically reload balances after receiving BalanceChange 
notification ...
             .onNotification(.BalanceChange) { notification in
-                // doesn't need to be received on main thread because we just 
reload in the background anyway
-                symLog?.log(".onNotification(.BalanceChange) ==> shouldLoad = 
true")
-                shouldLoad = true
+                // reload balances on receiving BalanceChange notification ...
+                // doesn't need to be received on main thread because we just 
reload in a background task anyway
+                symLog?.log(".onNotification(.BalanceChange) ==> reload")
+                Task {
+                    await reloadAction()
+                }
             }
         } // body
     } // Content

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