Parenthesize to avoid a misbehavior

This commit is contained in:
Leeingnyo 2021-08-19 14:46:10 +09:00
parent 83b122ab75
commit a703175b3a

View File

@ -56,7 +56,7 @@ const readerComponent = () => {
} }
// Preload Images // Preload Images
this.preloadLookahead = +localStorage.getItem('preloadLookahead') ?? 3; 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 + 1);
for (let idx = page + 1; idx <= limit; idx++) { for (let idx = page + 1; idx <= limit; idx++) {
this.preloadImage(this.items[idx - 1].url); this.preloadImage(this.items[idx - 1].url);