From 75bf63d936ca94ca479967a87b560802dd0dc92b Mon Sep 17 00:00:00 2001 From: Craig Raw Date: Mon, 17 Aug 2020 17:25:33 +0200 Subject: [PATCH] fix wallet settings update bugs --- .../java/com/sparrowwallet/sparrow/control/UtxosChart.java | 2 +- .../sparrowwallet/sparrow/wallet/TransactionsController.java | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/sparrowwallet/sparrow/control/UtxosChart.java b/src/main/java/com/sparrowwallet/sparrow/control/UtxosChart.java index 1c545b3b..483d8eeb 100644 --- a/src/main/java/com/sparrowwallet/sparrow/control/UtxosChart.java +++ b/src/main/java/com/sparrowwallet/sparrow/control/UtxosChart.java @@ -62,7 +62,7 @@ public class UtxosChart extends BarChart { } if(utxoSeries.getData().size() > utxoDataList.size()) { - utxoSeries.getData().remove(utxoDataList.size() - 1, utxoSeries.getData().size()); + utxoSeries.getData().remove(Math.max(0, utxoDataList.size() - 1), utxoSeries.getData().size()); } if(selectedEntries != null) { diff --git a/src/main/java/com/sparrowwallet/sparrow/wallet/TransactionsController.java b/src/main/java/com/sparrowwallet/sparrow/wallet/TransactionsController.java index d9198d04..07663ecd 100644 --- a/src/main/java/com/sparrowwallet/sparrow/wallet/TransactionsController.java +++ b/src/main/java/com/sparrowwallet/sparrow/wallet/TransactionsController.java @@ -14,7 +14,6 @@ import javafx.collections.ListChangeListener; import javafx.fxml.FXML; import javafx.fxml.Initializable; import javafx.scene.control.TreeItem; -import javafx.scene.input.MouseEvent; import java.net.URL; import java.util.ResourceBundle; @@ -47,8 +46,10 @@ public class TransactionsController extends WalletFormController implements Init transactionsTable.initialize(walletTransactionsEntry); + balance.valueProperty().addListener((observable, oldValue, newValue) -> { + setFiatBalance(AppController.getFiatCurrencyExchangeRate(), newValue.longValue()); + }); balance.setValue(walletTransactionsEntry.getBalance()); - setFiatBalance(AppController.getFiatCurrencyExchangeRate(), walletTransactionsEntry.getBalance()); mempoolBalance.setValue(walletTransactionsEntry.getMempoolBalance()); balanceChart.initialize(walletTransactionsEntry);