From 0e4169cb22bb6546dc1488dea999b09d4c85b538 Mon Sep 17 00:00:00 2001 From: Leeingnyo Date: Fri, 13 May 2022 08:43:25 +0900 Subject: [PATCH] Fix preload bug cause index error --- public/js/reader.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/js/reader.js b/public/js/reader.js index 2cb3a666..4b0ff010 100644 --- a/public/js/reader.js +++ b/public/js/reader.js @@ -58,7 +58,7 @@ const readerComponent = () => { // Preload Images this.preloadLookahead = +(localStorage.getItem('preloadLookahead') ?? 3); - const limit = Math.min(page + this.preloadLookahead, this.items.length + 1); + const limit = Math.min(page + this.preloadLookahead, this.items.length); for (let idx = page + 1; idx <= limit; idx++) { this.preloadImage(this.items[idx - 1].url); }