mirror of
https://github.com/bisq-network/bisq.git
synced 2024-11-19 18:03:12 +01:00
Add static method getTradeStatisticsForCurrency and
use it instead of updateSelectedTradeStatistics (preparation for follow up commit)
This commit is contained in:
parent
0271af995b
commit
ca145b0eb3
@ -168,7 +168,11 @@ class TradesChartsViewModel extends ActivatableViewModel {
|
||||
this.usdAveragePriceMapsPerTickUnit.clear();
|
||||
this.usdAveragePriceMapsPerTickUnit.putAll(usdAveragePriceMapsPerTickUnit);
|
||||
|
||||
updateSelectedTradeStatistics(getCurrencyCode());
|
||||
List<TradeStatistics3> list = getTradeStatisticsForCurrency(tradeStatisticsManager.getObservableTradeStatisticsSet(),
|
||||
getCurrencyCode(),
|
||||
showAllTradeCurrenciesProperty.get());
|
||||
selectedTradeStatistics.setAll(list);
|
||||
|
||||
updateChartData();
|
||||
modelReady.set(true);
|
||||
});
|
||||
@ -318,6 +322,14 @@ class TradesChartsViewModel extends ActivatableViewModel {
|
||||
.collect(Collectors.toList()));
|
||||
}
|
||||
|
||||
private static List<TradeStatistics3> getTradeStatisticsForCurrency(Set<TradeStatistics3> tradeStatisticsSet,
|
||||
String currencyCode,
|
||||
boolean showAllTradeCurrencies) {
|
||||
return tradeStatisticsSet.stream()
|
||||
.filter(e -> showAllTradeCurrencies || e.getCurrency().equals(currencyCode))
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
private void updateSelectedTradeStatistics(String currencyCode) {
|
||||
selectedTradeStatistics.setAll(tradeStatisticsManager.getObservableTradeStatisticsSet().stream()
|
||||
.filter(e -> showAllTradeCurrenciesProperty.get() || e.getCurrency().equals(currencyCode))
|
||||
|
Loading…
Reference in New Issue
Block a user