diff --git a/name.abuchen.portfolio.ui/src/name/abuchen/portfolio/ui/views/AllTransactionsView.java b/name.abuchen.portfolio.ui/src/name/abuchen/portfolio/ui/views/AllTransactionsView.java index 080353c6ab..b188e6125c 100644 --- a/name.abuchen.portfolio.ui/src/name/abuchen/portfolio/ui/views/AllTransactionsView.java +++ b/name.abuchen.portfolio.ui/src/name/abuchen/portfolio/ui/views/AllTransactionsView.java @@ -209,25 +209,31 @@ public FilterDropDown(IPreferenceStore preferenceStore) Consumer listener = f -> { setInformationPaneInput(null); - if (f instanceof PortfolioClientFilter pcf) - AllTransactionsView.this.clientFilter = pcf; - else - AllTransactionsView.this.clientFilter = null; + setupFilterInView(f); notifyModelUpdated(); }; clientFilterMenu.addListener(listener); clientFilterMenu.addListener(f -> updateIcon()); - // as we register the listener above, the selected filter will be - // injected into the view immediately clientFilterMenu.trackSelectedFilterConfigurationKey(AllTransactionsView.class.getSimpleName()); + // set initial filter + setupFilterInView(clientFilterMenu.getSelectedFilter()); + updateIcon(); addDisposeListener(e -> preferenceStore.setValue(TRANSACTION_FILTER_PREFERENCE_NAME, typeFilter.name())); } + private void setupFilterInView(ClientFilter filter) + { + if (filter instanceof PortfolioClientFilter pcf) + AllTransactionsView.this.clientFilter = pcf; + else + AllTransactionsView.this.clientFilter = null; + } + private void updateIcon() { boolean hasActiveFilter = clientFilterMenu.hasActiveFilter() || typeFilter != DEFAULT_TYPE_FILTER;