File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed
Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -62,6 +62,7 @@ function highlightMatches(text: string, matchedText: string[]): string {
6262}
6363
6464function applyQuoteLengthFilter ( quotes : Quote [ ] ) : Quote [ ] {
65+ if ( ! modal . isOpen ( ) ) return [ ] ;
6566 const quoteLengthFilterValue = $ (
6667 "#quoteSearchModal .quoteLengthFilter"
6768 ) . val ( ) as string [ ] ;
@@ -80,6 +81,7 @@ function applyQuoteLengthFilter(quotes: Quote[]): Quote[] {
8081}
8182
8283function applyQuoteFavFilter ( quotes : Quote [ ] ) : Quote [ ] {
84+ if ( ! modal . isOpen ( ) ) return [ ] ;
8385 const showFavOnly = (
8486 document . querySelector ( ".toggleFavorites" ) as HTMLDivElement
8587 ) . classList . contains ( "active" ) ;
@@ -154,6 +156,8 @@ function buildQuoteSearchResult(
154156}
155157
156158async function updateResults ( searchText : string ) : Promise < void > {
159+ if ( ! modal . isOpen ( ) ) return ;
160+
157161 const { quotes } = await QuotesController . getQuotes ( Config . language ) ;
158162
159163 const quoteSearchService = getSearchService < Quote > (
@@ -334,6 +338,7 @@ function apply(val: number): void {
334338}
335339
336340const searchForQuotes = debounce ( 250 , ( ) : void => {
341+ if ( ! modal . isOpen ( ) ) return ;
337342 const searchText = ( document . getElementById ( "searchBox" ) as HTMLInputElement )
338343 . value ;
339344 currentPageNumber = 1 ;
You can’t perform that action at this time.
0 commit comments