Skip to content

Commit

Permalink
move call
Browse files Browse the repository at this point in the history
  • Loading branch information
tatsumoto-ren committed Apr 14, 2024
1 parent d6ea389 commit db2cc48
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions cropro.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,10 +316,12 @@ def populate_other_profile_decks(self):
]
)

def _should_abort_search(self, is_web: bool) -> bool:
return self._search_lock.is_searching() or config.search_the_web is not is_web or self.isVisible() is False
def _should_abort_search(self) -> bool:
return self._search_lock.is_searching() or not self.isVisible()

def perform_search(self, search_text: str):
if self._should_abort_search():
return
if config.search_the_web:
return self.perform_remote_search(search_text)
else:
Expand All @@ -329,9 +331,6 @@ def perform_remote_search(self, search_text: str):
"""
Search notes on a remote server.
"""
if self._should_abort_search(is_web=True):
return

self._ensure_enabled_search_mode()
self.reset_cropro_status()

Expand Down Expand Up @@ -375,9 +374,6 @@ def perform_local_search(self, search_text: str):
"""
Search notes in a different Anki collection.
"""
if self._should_abort_search(is_web=False):
return

self._ensure_enabled_search_mode()
self.reset_cropro_status()
self.open_other_col()
Expand Down

0 comments on commit db2cc48

Please sign in to comment.