Fix regression in deletion

pull/37/head
Varun Patil 2022-09-09 20:11:22 -07:00
parent 04d8778a0e
commit 260f64248d
1 changed files with 12 additions and 19 deletions

View File

@ -575,8 +575,10 @@ export default {
// Add the photo to the row // Add the photo to the row
const photo = data[dataIdx]; const photo = data[dataIdx];
photo.flag = 0; // flags if (typeof photo.flag === "undefined") {
photo.d = day; // backref to day photo.flag = 0; // flags
photo.d = day; // backref to day
}
this.list[rowIdx].photos.push(photo); this.list[rowIdx].photos.push(photo);
dataIdx++; dataIdx++;
@ -811,7 +813,7 @@ export default {
nextExit = true; nextExit = true;
} else if (nextExit) { } else if (nextExit) {
photo.flag |= constants.FLAG_EXIT_LEFT; photo.flag |= constants.FLAG_EXIT_LEFT;
exitedLeft.add(photo.fileid); exitedLeft.add(photo);
} }
} }
} }
@ -828,15 +830,10 @@ export default {
} }
// Enter from right all photos that exited left // Enter from right all photos that exited left
for (const day of updatedDays) { exitedLeft.forEach((photo) => {
for (const row of day.rows) { photo.flag &= ~constants.FLAG_EXIT_LEFT;
for (const photo of row.photos) { photo.flag |= constants.FLAG_ENTER_RIGHT;
if (exitedLeft.has(photo.fileid)) { });
photo.flag |= constants.FLAG_ENTER_RIGHT;
}
}
}
}
// clear selection at this point // clear selection at this point
this.clearSelection(); this.clearSelection();
@ -845,13 +842,9 @@ export default {
await new Promise(resolve => setTimeout(resolve, 200)); await new Promise(resolve => setTimeout(resolve, 200));
// Clear enter right flags // Clear enter right flags
for (const day of updatedDays) { exitedLeft.forEach((photo) => {
for (const row of day.rows) { photo.flag &= ~constants.FLAG_ENTER_RIGHT;
for (const photo of row.photos) { });
photo.flag &= ~constants.FLAG_ENTER_RIGHT;
}
}
}
// Reflow timeline // Reflow timeline
this.reflowTimeline(); this.reflowTimeline();