Merge pull request #302 from Leeingnyo/fix/preload-bug

Fix preload bug
This commit is contained in:
Alex Ling 2022-05-13 20:11:20 +08:00 committed by GitHub
commit 883e01bbdd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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);
}