From a62cb960890909796aca8f637a5b840354c31d6c Mon Sep 17 00:00:00 2001 From: Dominik Prokop Date: Wed, 26 Apr 2023 13:41:31 +0200 Subject: [PATCH] QueryGroup: Fix infinite loop in edit mode (#67273) --- public/app/features/query/components/QueryGroup.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/public/app/features/query/components/QueryGroup.tsx b/public/app/features/query/components/QueryGroup.tsx index 54bd6c25e87..c3cb601104c 100644 --- a/public/app/features/query/components/QueryGroup.tsx +++ b/public/app/features/query/components/QueryGroup.tsx @@ -99,7 +99,8 @@ export class QueryGroup extends PureComponent { async componentDidUpdate() { 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); } }