diff options
| author | bobzel <zzzman@gmail.com> | 2020-08-22 09:49:56 -0400 |
|---|---|---|
| committer | bobzel <zzzman@gmail.com> | 2020-08-22 09:49:56 -0400 |
| commit | 4ed30f48bd0c87f0a5ccb484d78bf4601ab6ff74 (patch) | |
| tree | 15930585ee9bdf3b6278206cd1a3f972fa01c5f3 /src/client/views/pdf | |
| parent | cbedd8e1e651843e50f8f27163bf8e2a1a574009 (diff) | |
switched search from writiing searchMatch to matched docs to instead store in a run-time observableMap. This allows simultaneous searches by different users.
Diffstat (limited to 'src/client/views/pdf')
| -rw-r--r-- | src/client/views/pdf/PDFViewer.tsx | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/client/views/pdf/PDFViewer.tsx b/src/client/views/pdf/PDFViewer.tsx index 0916e8b0c..f2aa9fa3f 100644 --- a/src/client/views/pdf/PDFViewer.tsx +++ b/src/client/views/pdf/PDFViewer.tsx @@ -150,9 +150,9 @@ export class PDFViewer extends ViewBoxAnnotatableComponent<IViewerProps, PdfDocu runInAction(() => this._showWaiting = this._showCover = true); this.props.startupLive && this.setupPdfJsViewer(); this._mainCont.current && (this._mainCont.current.scrollTop = this.layoutDoc._scrollTop || 0); - this._searchReactionDisposer = reaction(() => this.Document.searchMatch, + this._searchReactionDisposer = reaction(() => Doc.IsSearchMatch(this.rootDoc), m => { - if (m !== undefined) (this._lastSearch = true) && this.search(Doc.SearchQuery(), true); + if (m) (this._lastSearch = true) && this.search(Doc.SearchQuery(), m.searchMatch > 0); else !(this._lastSearch = false) && setTimeout(() => !this._lastSearch && this.search("", false, true), 200); }, { fireImmediately: true }); |
