mirror of
https://github.com/sparrowwallet/sparrow.git
synced 2024-12-26 05:26:45 +00:00
avoid showing balance in fiat when exchange source is none
This commit is contained in:
parent
d8839763a4
commit
e1fb674170
2 changed files with 4 additions and 3 deletions
|
@ -6,9 +6,9 @@ import com.googlecode.lanterna.TerminalSize;
|
||||||
import com.googlecode.lanterna.gui2.*;
|
import com.googlecode.lanterna.gui2.*;
|
||||||
import com.googlecode.lanterna.gui2.table.Table;
|
import com.googlecode.lanterna.gui2.table.Table;
|
||||||
import com.googlecode.lanterna.gui2.table.TableModel;
|
import com.googlecode.lanterna.gui2.table.TableModel;
|
||||||
import com.sparrowwallet.drongo.protocol.Transaction;
|
|
||||||
import com.sparrowwallet.sparrow.AppServices;
|
import com.sparrowwallet.sparrow.AppServices;
|
||||||
import com.sparrowwallet.sparrow.event.*;
|
import com.sparrowwallet.sparrow.event.*;
|
||||||
|
import com.sparrowwallet.sparrow.io.Config;
|
||||||
import com.sparrowwallet.sparrow.net.ExchangeSource;
|
import com.sparrowwallet.sparrow.net.ExchangeSource;
|
||||||
import com.sparrowwallet.sparrow.terminal.SparrowTerminal;
|
import com.sparrowwallet.sparrow.terminal.SparrowTerminal;
|
||||||
import com.sparrowwallet.sparrow.terminal.wallet.table.CoinTableCell;
|
import com.sparrowwallet.sparrow.terminal.wallet.table.CoinTableCell;
|
||||||
|
@ -94,7 +94,7 @@ public class TransactionsDialog extends WalletDialog {
|
||||||
balance.setText(formatBitcoinValue(walletTransactionsEntry.getBalance(), true));
|
balance.setText(formatBitcoinValue(walletTransactionsEntry.getBalance(), true));
|
||||||
mempoolBalance.setText(formatBitcoinValue(walletTransactionsEntry.getMempoolBalance(), 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())));
|
fiatBalance.setText(formatFiatValue(getFiatValue(walletTransactionsEntry.getBalance(), AppServices.getFiatCurrencyExchangeRate())));
|
||||||
fiatMempoolBalance.setText(formatFiatValue(getFiatValue(walletTransactionsEntry.getMempoolBalance(), AppServices.getFiatCurrencyExchangeRate())));
|
fiatMempoolBalance.setText(formatFiatValue(getFiatValue(walletTransactionsEntry.getMempoolBalance(), AppServices.getFiatCurrencyExchangeRate())));
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -12,6 +12,7 @@ import com.sparrowwallet.drongo.wallet.*;
|
||||||
import com.sparrowwallet.sparrow.AppServices;
|
import com.sparrowwallet.sparrow.AppServices;
|
||||||
import com.sparrowwallet.sparrow.EventManager;
|
import com.sparrowwallet.sparrow.EventManager;
|
||||||
import com.sparrowwallet.sparrow.event.*;
|
import com.sparrowwallet.sparrow.event.*;
|
||||||
|
import com.sparrowwallet.sparrow.io.Config;
|
||||||
import com.sparrowwallet.sparrow.net.ExchangeSource;
|
import com.sparrowwallet.sparrow.net.ExchangeSource;
|
||||||
import com.sparrowwallet.sparrow.terminal.ModalDialog;
|
import com.sparrowwallet.sparrow.terminal.ModalDialog;
|
||||||
import com.sparrowwallet.sparrow.terminal.SparrowTerminal;
|
import com.sparrowwallet.sparrow.terminal.SparrowTerminal;
|
||||||
|
@ -233,7 +234,7 @@ public class UtxosDialog extends WalletDialog {
|
||||||
balance.setText(formatBitcoinValue(walletUtxosEntry.getBalance(), true));
|
balance.setText(formatBitcoinValue(walletUtxosEntry.getBalance(), true));
|
||||||
mempoolBalance.setText(formatBitcoinValue(walletUtxosEntry.getMempoolBalance(), 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())));
|
fiatBalance.setText(formatFiatValue(getFiatValue(walletUtxosEntry.getBalance(), AppServices.getFiatCurrencyExchangeRate())));
|
||||||
fiatMempoolBalance.setText(formatFiatValue(getFiatValue(walletUtxosEntry.getMempoolBalance(), AppServices.getFiatCurrencyExchangeRate())));
|
fiatMempoolBalance.setText(formatFiatValue(getFiatValue(walletUtxosEntry.getMempoolBalance(), AppServices.getFiatCurrencyExchangeRate())));
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue