Offers list respects currency filter settings and only shows those offers in which the user is interested

This commit is contained in:
dhingra 2017-12-26 22:11:55 -05:00
parent 76e1cd2eca
commit f379757af3

View File

@ -420,7 +420,8 @@ class OfferBookViewModel extends ActivatableViewModel {
filteredItems.setPredicate(offerBookListItem -> {
Offer offer = offerBookListItem.getOffer();
boolean directionResult = offer.getDirection() != direction;
boolean currencyResult = showAllTradeCurrenciesProperty.get() ||
boolean isPreferredCurrency = getTradeCurrencies().stream().filter(c -> c.getCode().equals(offer.getCurrencyCode())).findAny().isPresent();
boolean currencyResult = showAllTradeCurrenciesProperty.get() && isPreferredCurrency ||
offer.getCurrencyCode().equals(selectedTradeCurrency.getCode());
boolean paymentMethodResult = showAllPaymentMethods ||
offer.getPaymentMethod().equals(selectedPaymentMethod);