From e1fb6741705610434f305780a6cb46c651e314cc Mon Sep 17 00:00:00 2001 From: Craig Raw Date: Wed, 29 Nov 2023 09:32:01 +0200 Subject: [PATCH] avoid showing balance in fiat when exchange source is none --- .../sparrow/terminal/wallet/TransactionsDialog.java | 4 ++-- .../sparrowwallet/sparrow/terminal/wallet/UtxosDialog.java | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/sparrowwallet/sparrow/terminal/wallet/TransactionsDialog.java b/src/main/java/com/sparrowwallet/sparrow/terminal/wallet/TransactionsDialog.java index 5f4d08f8..b6264c60 100644 --- a/src/main/java/com/sparrowwallet/sparrow/terminal/wallet/TransactionsDialog.java +++ b/src/main/java/com/sparrowwallet/sparrow/terminal/wallet/TransactionsDialog.java @@ -6,9 +6,9 @@ import com.googlecode.lanterna.TerminalSize; import com.googlecode.lanterna.gui2.*; import com.googlecode.lanterna.gui2.table.Table; import com.googlecode.lanterna.gui2.table.TableModel; -import com.sparrowwallet.drongo.protocol.Transaction; import com.sparrowwallet.sparrow.AppServices; import com.sparrowwallet.sparrow.event.*; +import com.sparrowwallet.sparrow.io.Config; import com.sparrowwallet.sparrow.net.ExchangeSource; import com.sparrowwallet.sparrow.terminal.SparrowTerminal; import com.sparrowwallet.sparrow.terminal.wallet.table.CoinTableCell; @@ -94,7 +94,7 @@ public class TransactionsDialog extends WalletDialog { balance.setText(formatBitcoinValue(walletTransactionsEntry.getBalance(), true)); mempoolBalance.setText(formatBitcoinValue(walletTransactionsEntry.getMempoolBalance(), true)); - if(AppServices.getFiatCurrencyExchangeRate() != null) { + if(AppServices.getFiatCurrencyExchangeRate() != null && Config.get().getExchangeSource() != ExchangeSource.NONE) { fiatBalance.setText(formatFiatValue(getFiatValue(walletTransactionsEntry.getBalance(), AppServices.getFiatCurrencyExchangeRate()))); fiatMempoolBalance.setText(formatFiatValue(getFiatValue(walletTransactionsEntry.getMempoolBalance(), AppServices.getFiatCurrencyExchangeRate()))); } else { diff --git a/src/main/java/com/sparrowwallet/sparrow/terminal/wallet/UtxosDialog.java b/src/main/java/com/sparrowwallet/sparrow/terminal/wallet/UtxosDialog.java index 47defff6..69da47c3 100644 --- a/src/main/java/com/sparrowwallet/sparrow/terminal/wallet/UtxosDialog.java +++ b/src/main/java/com/sparrowwallet/sparrow/terminal/wallet/UtxosDialog.java @@ -12,6 +12,7 @@ import com.sparrowwallet.drongo.wallet.*; import com.sparrowwallet.sparrow.AppServices; import com.sparrowwallet.sparrow.EventManager; import com.sparrowwallet.sparrow.event.*; +import com.sparrowwallet.sparrow.io.Config; import com.sparrowwallet.sparrow.net.ExchangeSource; import com.sparrowwallet.sparrow.terminal.ModalDialog; import com.sparrowwallet.sparrow.terminal.SparrowTerminal; @@ -233,7 +234,7 @@ public class UtxosDialog extends WalletDialog { balance.setText(formatBitcoinValue(walletUtxosEntry.getBalance(), true)); mempoolBalance.setText(formatBitcoinValue(walletUtxosEntry.getMempoolBalance(), true)); - if(AppServices.getFiatCurrencyExchangeRate() != null) { + if(AppServices.getFiatCurrencyExchangeRate() != null && Config.get().getExchangeSource() != ExchangeSource.NONE) { fiatBalance.setText(formatFiatValue(getFiatValue(walletUtxosEntry.getBalance(), AppServices.getFiatCurrencyExchangeRate()))); fiatMempoolBalance.setText(formatFiatValue(getFiatValue(walletUtxosEntry.getMempoolBalance(), AppServices.getFiatCurrencyExchangeRate()))); } else {