From 9ddbfed730ced7d0825db71d96a311842a2d4faa Mon Sep 17 00:00:00 2001 From: Dominik Prokop Date: Tue, 29 Jan 2019 15:52:36 +0100 Subject: [PATCH] Wait for queries to be imported before proceeding with datasource change --- public/app/features/explore/state/actions.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/public/app/features/explore/state/actions.ts b/public/app/features/explore/state/actions.ts index f9092fb4206..3d2896f38d3 100644 --- a/public/app/features/explore/state/actions.ts +++ b/public/app/features/explore/state/actions.ts @@ -75,7 +75,8 @@ export function changeDatasource(exploreId: ExploreId, datasource: string): Thun const currentDataSourceInstance = getState().explore[exploreId].datasourceInstance; const modifiedQueries = getState().explore[exploreId].modifiedQueries; - dispatch(importQueries(exploreId, modifiedQueries, currentDataSourceInstance, newDataSourceInstance)); + await dispatch(importQueries(exploreId, modifiedQueries, currentDataSourceInstance, newDataSourceInstance)); + dispatch(updateDatasourceInstance(exploreId, newDataSourceInstance)); dispatch(loadDatasource(exploreId, newDataSourceInstance)); };