Skip to content

Commit

Permalink
Remove a superfluous linkService.isPageVisible check from `PDFFindC…
Browse files Browse the repository at this point in the history
…ontroller` (PR 10217 follow-up)

Unless the `PDFLinkService` instance contains all of the expected methods, a lot of things will break in various places in the default viewer. Hence there's not much value in having this check, and outright falling seems more appropriate.

Finally, this also makes the return value explicit in this case, since that's consistent with the rest of the `PDFFindController._shouldDirtyMatch` method.
  • Loading branch information
Snuffleupagus committed Jun 10, 2019
1 parent 06b253d commit 9f5a64e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions web/pdf_find_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -252,9 +252,9 @@ class PDFFindController {
// over matches at the top/bottom of pages thus making them completely
// inaccessible when there's multiple pages visible in the viewer.
if (pageNumber >= 1 && pageNumber <= linkService.pagesCount &&
linkService.page !== pageNumber && linkService.isPageVisible &&
linkService.page !== pageNumber &&
!linkService.isPageVisible(pageNumber)) {
break;
return true;
}
return false;
case 'findhighlightallchange':
Expand Down

0 comments on commit 9f5a64e

Please sign in to comment.