From 9f5a64e10c708c1856029b708ff08da936560730 Mon Sep 17 00:00:00 2001 From: Jonas Jenwald Date: Mon, 10 Jun 2019 17:11:21 +0200 Subject: [PATCH] Remove a superfluous `linkService.isPageVisible` check from `PDFFindController` (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. --- web/pdf_find_controller.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web/pdf_find_controller.js b/web/pdf_find_controller.js index a412eb566b6312..12d9a7192649e8 100644 --- a/web/pdf_find_controller.js +++ b/web/pdf_find_controller.js @@ -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':