mirror of
https://github.com/haveno-dex/haveno.git
synced 2025-08-10 15:40:22 -04:00
fix jfx error on offer book added
This commit is contained in:
parent
bdaa054c95
commit
3da228750f
4 changed files with 16 additions and 15 deletions
|
@ -32,7 +32,7 @@ import bisq.desktop.util.CurrencyList;
|
|||
import bisq.desktop.util.CurrencyListItem;
|
||||
import bisq.desktop.util.DisplayUtils;
|
||||
import bisq.desktop.util.GUIUtil;
|
||||
|
||||
import bisq.common.UserThread;
|
||||
import bisq.core.account.witness.AccountAgeWitnessService;
|
||||
import bisq.core.locale.CurrencyUtil;
|
||||
import bisq.core.locale.GlobalSettings;
|
||||
|
@ -125,17 +125,19 @@ class OfferBookChartViewModel extends ActivatableViewModel {
|
|||
|
||||
offerBookListItems = offerBook.getOfferBookListItems();
|
||||
offerBookListItemsListener = c -> {
|
||||
c.next();
|
||||
if (c.wasAdded() || c.wasRemoved()) {
|
||||
ArrayList<OfferBookListItem> list = new ArrayList<>(c.getRemoved());
|
||||
list.addAll(c.getAddedSubList());
|
||||
if (list.stream()
|
||||
.map(OfferBookListItem::getOffer)
|
||||
.anyMatch(e -> e.getCurrencyCode().equals(selectedTradeCurrencyProperty.get().getCode())))
|
||||
updateChartData();
|
||||
}
|
||||
UserThread.execute(() -> {
|
||||
c.next();
|
||||
if (c.wasAdded() || c.wasRemoved()) {
|
||||
ArrayList<OfferBookListItem> list = new ArrayList<>(c.getRemoved());
|
||||
list.addAll(c.getAddedSubList());
|
||||
if (list.stream()
|
||||
.map(OfferBookListItem::getOffer)
|
||||
.anyMatch(e -> e.getCurrencyCode().equals(selectedTradeCurrencyProperty.get().getCode())))
|
||||
updateChartData();
|
||||
}
|
||||
|
||||
fillTradeCurrencies();
|
||||
fillTradeCurrencies();
|
||||
});
|
||||
};
|
||||
|
||||
currenciesUpdatedListener = (observable, oldValue, newValue) -> {
|
||||
|
|
|
@ -22,7 +22,7 @@ import bisq.desktop.main.offer.offerbook.OfferBook;
|
|||
import bisq.desktop.main.offer.offerbook.OfferBookListItem;
|
||||
import bisq.desktop.main.overlays.popups.Popup;
|
||||
import bisq.desktop.util.GUIUtil;
|
||||
|
||||
import bisq.common.UserThread;
|
||||
import bisq.core.locale.Res;
|
||||
import bisq.core.monetary.Altcoin;
|
||||
import bisq.core.monetary.Price;
|
||||
|
@ -89,7 +89,7 @@ class SpreadViewModel extends ActivatableViewModel {
|
|||
this.formatter = formatter;
|
||||
includePaymentMethod = false;
|
||||
offerBookListItems = offerBook.getOfferBookListItems();
|
||||
listChangeListener = c -> update(offerBookListItems);
|
||||
listChangeListener = c -> UserThread.execute(() -> update(offerBookListItems));
|
||||
}
|
||||
|
||||
public String getKeyColumnName() {
|
||||
|
|
|
@ -87,7 +87,6 @@ import java.util.Optional;
|
|||
import java.util.Set;
|
||||
import java.util.function.Predicate;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue