do not reload chat filter when correct one is already set

This commit is contained in:
Daniel Gultsch 2023-03-12 21:18:13 +01:00
parent e22fcab844
commit 0f6f9b0001
No known key found for this signature in database
GPG key ID: F43D18AD2A0982C2

View file

@ -170,6 +170,11 @@ public class OverviewFragment extends Fragment {
} }
private void setChatFilter(final ChatFilter chatFilter) { 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 // this prevents animation between ChatFilter changes
// TODO This was added primarily to fix the lack of 'scrolling to top' after filter 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 // (if an item was in both); if we find a better solution we might as well bring back