diff --git a/CHANGELOG.md b/CHANGELOG.md index e145dae1..b9bab8f8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,9 @@ directly impact users rather than highlighting other key architectural updates.* - Delete Zashi feature has been added. It's accessible from the Advanced settings screen. It removes the wallet secrets from Zashi and resets its state. +### Changed +- We've improved the visibility logic of the little loader that is part of the Balances widget + ## [1.0 (638)] - 2024-04-26 ### Fixed diff --git a/ui-lib/src/main/java/co/electriccoin/zcash/ui/common/viewmodel/WalletViewModel.kt b/ui-lib/src/main/java/co/electriccoin/zcash/ui/common/viewmodel/WalletViewModel.kt index b9af82fa..264b09c4 100644 --- a/ui-lib/src/main/java/co/electriccoin/zcash/ui/common/viewmodel/WalletViewModel.kt +++ b/ui-lib/src/main/java/co/electriccoin/zcash/ui/common/viewmodel/WalletViewModel.kt @@ -31,6 +31,7 @@ import co.electriccoin.zcash.ui.common.model.OnboardingState import co.electriccoin.zcash.ui.common.model.WalletRestoringState import co.electriccoin.zcash.ui.common.model.WalletSnapshot import co.electriccoin.zcash.ui.common.model.hasChangePending +import co.electriccoin.zcash.ui.common.model.hasValuePending import co.electriccoin.zcash.ui.common.model.spendableBalance import co.electriccoin.zcash.ui.common.model.totalBalance import co.electriccoin.zcash.ui.preference.EncryptedPreferenceKeys @@ -251,13 +252,12 @@ class WalletViewModel(application: Application) : AndroidViewModel(application) .map { snapshot -> when { // Show the loader only under these conditions: - // - Available balance is currently zero - // - Wallet has some ChangePending in progress - // - And Total balance is non-zero + // - Available balance is currently zero AND total balance is non-zero + // - And wallet has some ChangePending or ValuePending in progress ( snapshot.spendableBalance().value == 0L && - snapshot.hasChangePending() && - snapshot.totalBalance().value > 0L + snapshot.totalBalance().value > 0L && + (snapshot.hasChangePending() || snapshot.hasValuePending()) ) -> { BalanceState.Loading( totalBalance = snapshot.totalBalance()