Balance on UI updated by the signal

This commit is contained in:
Ilya Kitaev
2016-06-17 16:35:07 +03:00
parent eaf59243b2
commit 8ac86a8042
3 changed files with 20 additions and 1 deletions

View File

@@ -142,10 +142,19 @@ ApplicationWindow {
console.log("Error initialize wallet: ", wallet.errorString);
return
}
// subscribing for wallet updates
wallet.updated.connect(onWalletUpdate);
// TODO: refresh asynchronously without blocking UI, implement signal(s)
wallet.refresh();
console.log("wallet balance: ", wallet.balance)
}
function onWalletUpdate() {
console.log("wallet updated")
leftPanel.unlockedBalanceText = walletManager.displayAmount(wallet.unlockedBalance);
leftPanel.balanceText = walletManager.displayAmount(wallet.balance);
}
@@ -176,8 +185,11 @@ ApplicationWindow {
+ ", fee: " + walletManager.displayAmount(pendingTransaction.fee));
if (!pendingTransaction.commit()) {
console.log("Error committing transaction: " + pendingTransaction.errorString);
} else {
wallet.refresh();
}
}
wallet.disposeTransaction(pendingTransaction);
}