From 0f6f9b00010e2e70c9f92c46f68195ae9507a1ad Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Sun, 12 Mar 2023 21:18:13 +0100 Subject: [PATCH] do not reload chat filter when correct one is already set --- .../android/ui/fragment/main/OverviewFragment.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/src/main/java/im/conversations/android/ui/fragment/main/OverviewFragment.java b/app/src/main/java/im/conversations/android/ui/fragment/main/OverviewFragment.java index 26844b74b..51dba6cbd 100644 --- a/app/src/main/java/im/conversations/android/ui/fragment/main/OverviewFragment.java +++ b/app/src/main/java/im/conversations/android/ui/fragment/main/OverviewFragment.java @@ -170,6 +170,11 @@ public class OverviewFragment extends Fragment { } private void setChatFilter(final ChatFilter chatFilter) { + if (Objects.equals(overviewViewModel.getChatFilter(), chatFilter)) { + LOGGER.debug("Chat filter is already in correct state"); + binding.drawerLayout.close(); + return; + } // this prevents animation between ChatFilter changes // TODO This was added primarily to fix the lack of 'scrolling to top' after filter changes // (if an item was in both); if we find a better solution we might as well bring back