Skip to content

Commit

Permalink
EPUB/Snapshot: Fix Find popup showing spinner forever
Browse files Browse the repository at this point in the history
When a query is typed, changed, then changed back within the debounce
timeout.
  • Loading branch information
AbeJellinek committed Aug 16, 2024
1 parent 17e0038 commit 824c2ab
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/dom/epub/epub-view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -788,7 +788,8 @@ class EPUBView extends DOMView<EPUBViewState, EPUBViewData> {
|| previousState.query !== state.query
|| previousState.caseSensitive !== state.caseSensitive
|| previousState.entireWord !== state.entireWord
|| previousState.active !== state.active) {
|| previousState.active !== state.active
|| !previousState.result) {
console.log('Initiating new search', state);
this._find = new EPUBFindProcessor({
view: this,
Expand Down
3 changes: 2 additions & 1 deletion src/dom/snapshot/snapshot-view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,8 @@ class SnapshotView extends DOMView<SnapshotViewState, SnapshotViewData> {
|| previousState.query !== state.query
|| previousState.caseSensitive !== state.caseSensitive
|| previousState.entireWord !== state.entireWord
|| previousState.active !== state.active) {
|| previousState.active !== state.active
|| !previousState.result) {
console.log('Initiating new search', state);
this._find = new DefaultFindProcessor({
searchContext: this._getSearchContext(),
Expand Down

1 comment on commit 824c2ab

@AbeJellinek
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mrtcode: PDF view seems to have the same problem!

  1. Type "abc"
  2. Wait for search to execute
  3. Delete the last "c" and quickly re-type it

Please sign in to comment.