Fix wrong equal check, check for cryptocurrency before fiat

This commit is contained in:
Manfred Karrer 2016-05-11 00:10:28 +02:00
parent 37c7993d19
commit 42cbe6e2ca

View File

@ -119,16 +119,16 @@ public class PriceFeed {
}
public void setCurrencyCode(String currencyCode) {
if (this.currencyCode != currencyCode) {
if (this.currencyCode == null || !this.currencyCode.equals(currencyCode)) {
this.currencyCode = currencyCode;
currencyCodeProperty.set(currencyCode);
applyPrice();
if (CurrencyUtil.isFiatCurrency(currencyCode)) {
requestPrice(fiatPriceProvider);
} else {
if (CurrencyUtil.isCryptoCurrency(currencyCode)) {
// Poloniex does not support calls for one currency just for all which is quite a bit of data
requestAllPrices(cryptoCurrenciesPriceProvider, this::applyPrice);
} else {
requestPrice(fiatPriceProvider);
}
}
}