Skip to content

Commit

Permalink
Fix table sorting in descending order (#7863)
Browse files Browse the repository at this point in the history
When adding sorted arrays to the beginning, make sure to insert them in the same order and not accidentally reverse them while inserting.

Co-authored-by: Andrew Henry <[email protected]>
Co-authored-by: John Hill <[email protected]>
  • Loading branch information
3 people authored Oct 8, 2024
1 parent 47f0b66 commit 83e4a12
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/plugins/telemetryTable/collections/TableRowCollection.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,13 +150,13 @@ export default class TableRowCollection extends EventEmitter {
}

insertOrUpdateRows(rowsToAdd, addToBeginning) {
rowsToAdd.forEach((row) => {
rowsToAdd.forEach((row, addRowsIndex) => {
const index = this.getInPlaceUpdateIndex(row);
if (index > -1) {
this.updateRowInPlace(row, index);
} else {
if (addToBeginning) {
this.rows.unshift(row);
this.rows.splice(addRowsIndex, 0, row);
} else {
this.rows.push(row);
}
Expand Down

0 comments on commit 83e4a12

Please sign in to comment.