From dc445edaae6dd7cb98b5337566aa4a5495e97b6b Mon Sep 17 00:00:00 2001 From: Sander Ferdinand Date: Thu, 23 Nov 2017 15:28:52 +0100 Subject: Hide 'unlocked balance' when no funds are available --- main.qml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'main.qml') diff --git a/main.qml b/main.qml index 3b57a523..d23069d0 100644 --- a/main.qml +++ b/main.qml @@ -381,6 +381,23 @@ ApplicationWindow { function onWalletUpdate() { console.log(">>> wallet updated") updateBalance(); + var unlockedBalance = walletManager.displayAmount(currentWallet.unlockedBalance); + var unlockedBalanceFloat = parseFloat(unlockedBalance); + + if(unlockedBalanceFloat === 0){ + // no available funds; hide the 'unlocked balance' label + leftPanel.unlockedBalanceVisible = false + leftPanel.unlockedBalanceLabelVisible = false + } else { + leftPanel.unlockedBalanceVisible = true + leftPanel.unlockedBalanceLabelVisible = true + leftPanel.unlockedBalanceText.text = unlockedBalance + } + + // showing middlePanel unlockedBalance regardless + middlePanel.unlockedBalanceText = leftPanel.unlockedBalanceText = unlockedBalance; + middlePanel.balanceText = leftPanel.balanceText = walletManager.displayAmount(currentWallet.balance); + // Update history if new block found since last update if(foundNewBlock) { foundNewBlock = false; -- cgit v1.2.3