Skip to content

Commit

Permalink
PasswordDialog: hide balance when passwordDialog is open ✨
Browse files Browse the repository at this point in the history
  • Loading branch information
mmbyday committed Dec 13, 2018
1 parent 59fc48b commit 4322d43
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
6 changes: 6 additions & 0 deletions components/PasswordDialog.qml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ Item {
property alias password: passwordInput.text
property string walletName
property string errorText
property bool tempHideBalanceFlag

// same signals as Dialog has
signal accepted()
Expand All @@ -61,6 +62,9 @@ Item {
root.visible = true;
passwordInput.forceActiveFocus();
passwordInput.text = ""
tempHideBalanceFlag = persistentSettings.hideBalance;
persistentSettings.hideBalance = true;
appWindow.updateBalance()
}

function showError(errorText) {
Expand All @@ -73,6 +77,8 @@ Item {
middlePanel.enabled = true
titleBar.enabled = true
root.visible = false;
persistentSettings.hideBalance = tempHideBalanceFlag;
appWindow.updateBalance()
closeCallback();
}

Expand Down
5 changes: 1 addition & 4 deletions main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -353,12 +353,9 @@ ApplicationWindow {
}

function updateBalance() {
if (!currentWallet)
return;

var balance_unlocked = qsTr("HIDDEN");
var balance = qsTr("HIDDEN");
if(!persistentSettings.hideBalance){
if(!persistentSettings.hideBalance && currentWallet){
balance_unlocked = walletManager.displayAmount(currentWallet.unlockedBalance(currentWallet.currentSubaddressAccount));
balance = walletManager.displayAmount(currentWallet.balance(currentWallet.currentSubaddressAccount));
}
Expand Down

0 comments on commit 4322d43

Please sign in to comment.