fix(dashboard): check dashboard id before calling redux methods (#15921)

* check dashboard id before calling redux methods

* comment
This commit is contained in:
David Aaron Suddjian 2021-07-28 13:45:09 -07:00 committed by GitHub
parent 7b0acc45de
commit ac9c1372b4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 0 deletions

View File

@ -132,6 +132,11 @@ class Dashboard extends React.PureComponent {
const currentChartIds = getChartIdsFromLayout(this.props.layout);
const nextChartIds = getChartIdsFromLayout(nextProps.layout);
if (this.props.dashboardInfo.id !== nextProps.dashboardInfo.id) {
// single-page-app navigation check
return;
}
if (currentChartIds.length < nextChartIds.length) {
const newChartIds = nextChartIds.filter(
key => currentChartIds.indexOf(key) === -1,