From 8ff0f8e4dfe347251524b171b6cf184da242787d Mon Sep 17 00:00:00 2001 From: Jonas Jenwald Date: Fri, 27 Aug 2021 17:29:00 +0200 Subject: [PATCH] Use optional chaining even more in the `web/app.js` file --- web/app.js | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/web/app.js b/web/app.js index f1c8fa003..5d12b6dda 100644 --- a/web/app.js +++ b/web/app.js @@ -853,12 +853,8 @@ const PDFViewerApplication = { this.pdfAttachmentViewer.reset(); this.pdfLayerViewer.reset(); - if (this.pdfHistory) { - this.pdfHistory.reset(); - } - if (this.findBar) { - this.findBar.reset(); - } + this.pdfHistory?.reset(); + this.findBar?.reset(); this.toolbar.reset(); this.secondaryToolbar.reset(); @@ -1850,9 +1846,7 @@ const PDFViewerApplication = { this.printService.destroy(); this.printService = null; - if (this.pdfDocument) { - this.pdfDocument.annotationStorage.resetModified(); - } + this.pdfDocument?.annotationStorage.resetModified(); } this.forceRendering(); }, @@ -1864,10 +1858,7 @@ const PDFViewerApplication = { }, requestPresentationMode() { - if (!this.pdfPresentationMode) { - return; - } - this.pdfPresentationMode.request(); + this.pdfPresentationMode?.request(); }, triggerPrinting() {