From e522b2d87e8eb3d4eb8a391a098a0f6f157e8c12 Mon Sep 17 00:00:00 2001 From: Jonas Jenwald Date: Fri, 29 Jun 2018 13:02:23 +0200 Subject: [PATCH] Remove the unused `PDFViewerApplication.documentFingerprint` property This property isn't accessed anywhere in the `web/app.js` file, and is also not being reset in `PDFViewerApplication.close`. Hence it seems that it can simply be removed, especially since the fingerprint is already synchronously available through `PDFViewerApplication.pdfDocument.fingerprint` (provided that a document is loaded). --- web/app.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/web/app.js b/web/app.js index e4f01cf15..6f704d658 100644 --- a/web/app.js +++ b/web/app.js @@ -973,8 +973,7 @@ let PDFViewerApplication = { this.toolbar.setPagesCount(pdfDocument.numPages, false); this.secondaryToolbar.setPagesCount(pdfDocument.numPages); - let id = this.documentFingerprint = pdfDocument.fingerprint; - let store = this.store = new ViewHistory(id); + const store = this.store = new ViewHistory(pdfDocument.fingerprint); let baseDocumentUrl; if (typeof PDFJSDev === 'undefined' || PDFJSDev.test('GENERIC')) { @@ -1003,7 +1002,7 @@ let PDFViewerApplication = { // The browsing history is only enabled when the viewer is standalone, // i.e. not when it is embedded in a web page. let resetHistory = !AppOptions.get('showPreviousViewOnLoad'); - this.pdfHistory.initialize(id, resetHistory); + this.pdfHistory.initialize(pdfDocument.fingerprint, resetHistory); if (this.pdfHistory.initialBookmark) { this.initialBookmark = this.pdfHistory.initialBookmark;