diff --git a/src/pyj/read_book/search.pyj b/src/pyj/read_book/search.pyj index 804ae917d5..2a21b43a23 100644 --- a/src/pyj/read_book/search.pyj +++ b/src/pyj/read_book/search.pyj @@ -213,9 +213,17 @@ class SearchOverlay: elif msg.id is self.search_in_flight.id: if msg.type is 'search_complete': self.search_in_flight.id = None + if Object.keys(self.result_map).length is 0: + self.no_result_received() elif msg.type is 'search_result': self.result_received(msg.result) + def no_result_received(self): + self.show_results() + self.results_container.appendChild(E.div( + style='margin: 1rem', + _('No matching results found'))) + def result_received(self, result): self.show_results() self.result_map[result.result_num] = result