diff --git a/web/app.js b/web/app.js index 012cb3159..83393b9b2 100644 --- a/web/app.js +++ b/web/app.js @@ -1188,17 +1188,12 @@ const PDFViewerApplication = { }, progress(level) { - if (!this.loadingBar || this.downloadComplete) { - // Don't accidentally show the loading bar again when the entire file has - // already been fetched (only an issue when disableAutoFetch is enabled). - return; - } const percent = Math.round(level * 100); // When we transition from full request to range requests, it's possible // that we discard some of the loaded data. This can cause the loading // bar to move backwards. So prevent this by only updating the bar if it // increases. - if (percent <= this.loadingBar.percent) { + if (!this.loadingBar || percent <= this.loadingBar.percent) { return; } this.loadingBar.percent = percent; diff --git a/web/ui_utils.js b/web/ui_utils.js index 1ed7e5a3d..08455659c 100644 --- a/web/ui_utils.js +++ b/web/ui_utils.js @@ -740,7 +740,7 @@ class ProgressBar { } setDisableAutoFetch(delay = /* ms = */ 5000) { - if (isNaN(this.#percent)) { + if (this.#percent === 100 || isNaN(this.#percent)) { return; } if (this.#disableAutoFetchTimeout) {