From 87096243391cf172c26190897c79321b3d42817c Mon Sep 17 00:00:00 2001
From: bobzel <zzzman@gmail.com>
Date: Mon, 19 Sep 2022 20:50:30 -0400
Subject: fixed searching in pdfs by updating to pdfjs's new findController api

---
 src/client/views/pdf/PDFViewer.tsx | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

(limited to 'src/client/views/pdf/PDFViewer.tsx')

diff --git a/src/client/views/pdf/PDFViewer.tsx b/src/client/views/pdf/PDFViewer.tsx
index 5925c0392..5c10c7cef 100644
--- a/src/client/views/pdf/PDFViewer.tsx
+++ b/src/client/views/pdf/PDFViewer.tsx
@@ -325,13 +325,13 @@ export class PDFViewer extends React.Component<IViewerProps> {
             query: searchString,
         };
         if (clear) {
-            this._pdfViewer?.findController.executeCommand('reset', { query: '' });
+            this._pdfViewer?.eventBus.dispatch('reset', {});
         } else if (!searchString) {
             bwd ? this.prevAnnotation() : this.nextAnnotation();
         } else if (this._pdfViewer?.pageViewsReady) {
-            this._pdfViewer.findController.executeCommand('findagain', findOpts);
+            this._pdfViewer?.eventBus.dispatch('find', { ...findOpts, type: 'again' });
         } else if (this._mainCont.current) {
-            const executeFind = () => this._pdfViewer.findController.executeCommand('find', findOpts);
+            const executeFind = () => this._pdfViewer?.eventBus.dispatch('find', findOpts);
             this._mainCont.current.addEventListener('pagesloaded', executeFind);
             this._mainCont.current.addEventListener('pagerendered', executeFind);
         }
-- 
cgit v1.2.3-70-g09d2

