Skip to content

Commit

Permalink
Display result box only after it's been populated
Browse files Browse the repository at this point in the history
  • Loading branch information
rdbende committed Dec 3, 2023
1 parent 33944e4 commit 3e70c78
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions cozy/ui/search_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,10 @@ def _populate_listbox(
if not results:
return

box.set_visible(True)

for result in results:
if self.search_thread_stop.is_set():
return

listbox.append(row_type(result, callback))

box.set_visible(True)
2 changes: 1 addition & 1 deletion cozy/view_model/search_view_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def readers(self):

return split_strings_to_set(readers)

def search(self, search_query: str, callback: Callable[[], None], thread_event):
def search(self, search_query: str, callback: Callable[[list[Book], list[str], list[str]], None], thread_event):
search_query = search_query.lower()

# We need the main context to call methods in the main thread after the search is finished
Expand Down

0 comments on commit 3e70c78

Please sign in to comment.