Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve cleanup tor dir at seeds #5070

Merged
merged 13 commits into from
Jan 12, 2021
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ class TradesChartsViewModel extends ActivatableViewModel {
private static final int TAB_INDEX = 2;
private static final ZoneId ZONE_ID = ZoneId.systemDefault();


///////////////////////////////////////////////////////////////////////////////////////////
// Enum
///////////////////////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -116,7 +117,7 @@ public enum TickUnit {
final int maxTicks = 90;
private int selectedTabIndex;
final Map<TickUnit, Map<Long, Long>> usdPriceMapsPerTickUnit = new HashMap<>();

private boolean fillTradeCurrenciesOnActiavetCalled;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

spelling


///////////////////////////////////////////////////////////////////////////////////////////
// Constructor, lifecycle
Expand Down Expand Up @@ -150,7 +151,10 @@ public enum TickUnit {
@Override
protected void activate() {
tradeStatisticsManager.getObservableTradeStatisticsSet().addListener(setChangeListener);
fillTradeCurrencies();
if (!fillTradeCurrenciesOnActiavetCalled) {
fillTradeCurrencies();
fillTradeCurrenciesOnActiavetCalled = true;
}
buildUsdPricesPerDay();
updateChartData();
syncPriceFeedCurrency();
Expand Down Expand Up @@ -284,8 +288,9 @@ private long getAveragePrice(List<TradeStatistics3> tradeStatisticsList) {
}

private void updateChartData() {
String currencyCode = getCurrencyCode();
tradeStatisticsByCurrency.setAll(tradeStatisticsManager.getObservableTradeStatisticsSet().stream()
.filter(e -> showAllTradeCurrenciesProperty.get() || e.getCurrency().equals(getCurrencyCode()))
.filter(e -> showAllTradeCurrenciesProperty.get() || e.getCurrency().equals(currencyCode))
.collect(Collectors.toList()));

// Generate date range and create sets for all ticks
Expand Down