@@ -4,7 +4,7 @@ import { type IPdfContext, PdfContext } from "../PdfProvider/PdfProvider";
44
55import "./Search.css" ;
66
7- export function Search ( { onSearchFinished } : { onSearchFinished : ( ) => void } ) {
7+ export function Search ( { onSearchFinished } : { onSearchFinished : ( hasQuery : boolean ) => void } ) {
88 const { locationParams } = useContext ( LocationContext ) as ILocationContext ;
99 const [ query , setQuery ] = useState ( "" ) ;
1010 // search query is persistent between tab switches
@@ -14,7 +14,7 @@ export function Search({ onSearchFinished }: { onSearchFinished: () => void }) {
1414 if ( search ) {
1515 setQuery ( search ) ;
1616 } else {
17- onSearchFinished ( ) ;
17+ onSearchFinished ( false ) ;
1818 }
1919 } , [ search , onSearchFinished ] ) ;
2020
@@ -45,7 +45,7 @@ type PageResults = {
4545
4646type SearchResultsProps = {
4747 query : string ;
48- onSearchFinished : ( ) => void ;
48+ onSearchFinished : ( hasQuery : boolean ) => void ;
4949} ;
5050
5151function SearchResults ( { query, onSearchFinished } : SearchResultsProps ) {
@@ -112,7 +112,7 @@ function SearchResults({ query, onSearchFinished }: SearchResultsProps) {
112112 clearTimeout ( resetTimeout . current ) ;
113113 setIsLoading ( false ) ;
114114 setMatches ( { count, pagesAndCount } ) ;
115- onSearchFinished ( ) ;
115+ onSearchFinished ( true ) ;
116116 } ;
117117
118118 eventBus . on ( "updatefindmatchescount" , updateMatches ) ;
0 commit comments