Skip to content

Commit

Permalink
fix: column header filter tag disappearing when switching to chart an…
Browse files Browse the repository at this point in the history
…d back
  • Loading branch information
NikkiMeganMoore committed Sep 30, 2022
1 parent d3d3522 commit d2c50e4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/components/ChataTable/ChataTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,9 @@ export default class ChataTable extends React.Component {

ajaxRequestFunc = async (props, params) => {
try {
const prevTableParams = getTableParams(this.previousTableParams, this.ref)
const tableParams = getTableParams(params, this.ref)
if (_isEqual(this.previousTableParams, tableParams)) {
if (_isEqual(prevTableParams, tableParams)) {
return Promise.resolve()
}

Expand All @@ -197,7 +198,7 @@ export default class ChataTable extends React.Component {
return Promise.resolve({ rows: this.props.data, page: 1 })
}

this.previousTableParams = tableParams
this.previousTableParams = params

if (!props.queryRequestData) {
console.warn(
Expand All @@ -219,7 +220,7 @@ export default class ChataTable extends React.Component {
const responseWrapper = await this.sortOrFilterData(props, tableParams)
this.queryID = responseWrapper?.data?.data?.query_id
response = { ..._get(responseWrapper, 'data.data', {}), page: 1 }
this.props.onNewData(responseWrapper, tableParams)
this.props.onNewData(responseWrapper, params)
}

this.setState({ scrollLoading: false, pageLoading: false })
Expand Down
1 change: 1 addition & 0 deletions src/components/QueryOutput/QueryOutput.js
Original file line number Diff line number Diff line change
Expand Up @@ -859,6 +859,7 @@ export class QueryOutput extends React.Component {
this.setState({ tableParams: params })
setTimeout(() => {
this.props.onRowChange()
this.updateToolbars()
}, 0)
}

Expand Down

0 comments on commit d2c50e4

Please sign in to comment.