mirror of
https://github.com/monero-project/monero-gui.git
synced 2026-04-14 04:07:26 -04:00
Balance on UI updated by the signal
This commit is contained in:
12
main.qml
12
main.qml
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user