commit 9713c8ff3171dff36c5736692d2235c66cf2c948
parent 14a102693a0f032669b6bf9aa5ce3a79b04f3016
Author: Iván Ávalos <avalos@disroot.org>
Date: Thu, 13 Jul 2023 22:18:25 -0600
[wallet] Implement new `balance-change' notification
Diffstat:
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/wallet/src/main/java/net/taler/wallet/MainViewModel.kt b/wallet/src/main/java/net/taler/wallet/MainViewModel.kt
@@ -103,7 +103,11 @@ class MainViewModel(
if (payload.type == "waiting-for-retry") return // ignore ping)
Log.i(TAG, "Received notification from wallet-core: $payload")
- loadBalances()
+ // Only update balances when we're told they changed
+ if (payload.type == "balance-change") {
+ loadBalances()
+ }
+
if (payload.type in transactionNotifications) viewModelScope.launch(Dispatchers.Main) {
// TODO notification API should give us a currency to update
// update currently selected transaction list