QueryGroup: Fix infinite loop in edit mode (#67273)

This commit is contained in:
Dominik Prokop 2023-04-26 13:41:31 +02:00 committed by GitHub
parent d51e63520c
commit a62cb96089
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -99,7 +99,8 @@ export class QueryGroup extends PureComponent<Props, State> {
async componentDidUpdate() { async componentDidUpdate() {
const { options } = this.props; const { options } = this.props;
if (this.state.dataSource && options.dataSource.uid !== this.state.dataSource?.uid) { const currentDS = await getDataSourceSrv().get(options.dataSource);
if (this.state.dataSource && currentDS.uid !== this.state.dataSource?.uid) {
this.setNewQueriesAndDatasource(options); this.setNewQueriesAndDatasource(options);
} }
} }