mirror of
https://github.com/gristlabs/grist-core.git
synced 2024-10-27 20:44:07 +00:00
(core) Change array.reverse() in GranularAccess to avoid accidental in-place reversal.
Test Plan: Added a test case to tickle the bug this was causing. Reviewers: paulfitz Reviewed By: paulfitz Differential Revision: https://phab.getgrist.com/D2718
This commit is contained in:
parent
ec023a3ba6
commit
7c81cf2368
@ -642,8 +642,8 @@ export class GranularAccess {
|
|||||||
// TODO: this would need to be elaborated to work well on bundles containing table
|
// TODO: this would need to be elaborated to work well on bundles containing table
|
||||||
// renames.
|
// renames.
|
||||||
const tableId = getTableId(rowsBefore);
|
const tableId = getTableId(rowsBefore);
|
||||||
for (const snapshots of allRowSnapshots.reverse()) {
|
for (let i = allRowSnapshots.length - 1; i >= 0; i--) {
|
||||||
const rowsAfter = snapshots[1];
|
const rowsAfter = allRowSnapshots[i][1];
|
||||||
if (getTableId(rowsAfter) === tableId) {
|
if (getTableId(rowsAfter) === tableId) {
|
||||||
return {rowsBefore, rowsAfter};
|
return {rowsBefore, rowsAfter};
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user