Skip to content

Commit

Permalink
changed a clone method that was causing an error when certain task ta…
Browse files Browse the repository at this point in the history
…ble columns were present (#2249)
  • Loading branch information
AndrewPhilbin authored Jan 23, 2024
1 parent 8b5276d commit 35f598a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/components/TaskAnalysisTable/TaskAnalysisTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ import _reverse from 'lodash/reverse'
import _keys from 'lodash/keys'
import _concat from 'lodash/concat'
import _filter from 'lodash/filter'
import _cloneDeep from 'lodash/cloneDeep'
import _split from 'lodash/split'
import _isEmpty from 'lodash/isEmpty'
import _merge from 'lodash/merge'
import _pick from 'lodash/pick'
import parse from 'date-fns/parse'
import differenceInSeconds from 'date-fns/difference_in_seconds'
import { messagesByStatus,
Expand Down Expand Up @@ -104,7 +104,9 @@ export class TaskAnalysisTableInternal extends Component {
boundingBox: this.props.boundingBox,
includeTags: !!_get(this.props.addedColumns, 'tags')})

this.setState({lastTableState: _cloneDeep(tableState)})
// Use pick instead of cloneDeep, as cloning the entire tableState seems to cause an error
// when any column with a "makeInvertable" header is present.
this.setState({lastTableState: _pick(tableState, ["sorted", "filtered", "page"])})
}

configureColumns() {
Expand Down

0 comments on commit 35f598a

Please sign in to comment.