Skip to content

Commit

Permalink
Clear filters when changing context tabs
Browse files Browse the repository at this point in the history
Fixes #238
  • Loading branch information
nyalldawson committed Jun 6, 2023
1 parent db64b92 commit 7ec6f59
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions koordinates/gui/koordinates.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,7 @@ def __init__(self, parent):
super().__init__(parent)
self.setupUi(self)

self._block_searching = 0
self._facets = {}
self._current_facets_reply = None
self._visible_count = -1
Expand Down Expand Up @@ -666,12 +667,17 @@ def _context_tab_changed(self, current: int):
self.context_header.setVisible(True)

self._prev_tab = current

self._block_searching += 1
self.filter_widget.set_starred(current == self.TAB_STARRED_INDEX)

is_explore_tab = current == self.TAB_EXPLORE_INDEX
self.filter_widget.set_is_browse_tab(
is_explore_tab
)
self.filter_widget._clear_all()

self._block_searching -= 1
if not is_explore_tab:
# force browse tab
self.filter_widget.set_explore_mode(ExploreMode.Browse)
Expand All @@ -691,6 +697,9 @@ def _user_menu_about_to_show(self):
)

def search(self):
if self._block_searching:
return

browser_query = self.filter_widget.build_query()
context = self._current_context
self.browse_header_widget.show()
Expand Down

0 comments on commit 7ec6f59

Please sign in to comment.