1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-19 22:58:07 +02:00

Merge pull request #17676 from Snuffleupagus/app-findBar-optional-chain

Access `PDFViewerApplication.findBar` safely in more spots (PR 15831 follow-up)
This commit is contained in:
Jonas Jenwald 2024-02-17 13:54:00 +01:00 committed by GitHub
commit b767e12111
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -2286,7 +2286,7 @@ function webViewerNamedAction(evt) {
case "Find":
if (!PDFViewerApplication.supportsIntegratedFind) {
PDFViewerApplication?.findBar.toggle();
PDFViewerApplication.findBar?.toggle();
}
break;
@ -2517,7 +2517,7 @@ function webViewerUpdateFindMatchesCount({ matchesCount }) {
if (PDFViewerApplication.supportsIntegratedFind) {
PDFViewerApplication.externalServices.updateFindMatchesCount(matchesCount);
} else {
PDFViewerApplication.findBar.updateResultsCount(matchesCount);
PDFViewerApplication.findBar?.updateResultsCount(matchesCount);
}
}