Fix bug in scrollChange

pull/37/head
Varun Patil 2022-09-12 01:52:35 -07:00
parent df0edfb02d
commit 5711d18314
1 changed files with 6 additions and 1 deletions

View File

@ -362,13 +362,18 @@ export default {
const end = Math.min(endIndex, this.currentEnd); const end = Math.min(endIndex, this.currentEnd);
if (end - start > 0) { if (end - start > 0) {
this.loadScrollChanges(startIndex, endIndex); this.loadScrollChanges(start, end);
} }
}, SCROLL_LOAD_DELAY); }, SCROLL_LOAD_DELAY);
}, },
/** Load image data for given view */ /** Load image data for given view */
loadScrollChanges(startIndex, endIndex) { loadScrollChanges(startIndex, endIndex) {
// Make sure start and end valid
startIndex = Math.max(0, startIndex);
endIndex = Math.min(this.list.length - 1, endIndex);
// Fetch all visible days
for (let i = startIndex; i <= endIndex; i++) { for (let i = startIndex; i <= endIndex; i++) {
let item = this.list[i]; let item = this.list[i];
if (!item) { if (!item) {