Browse Source

Wait for queries to be imported before proceeding with datasource change

Dominik Prokop 7 years ago
parent
commit
9ddbfed730
1 changed files with 2 additions and 1 deletions
  1. 2 1
      public/app/features/explore/state/actions.ts

+ 2 - 1
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 currentDataSourceInstance = getState().explore[exploreId].datasourceInstance;
     const modifiedQueries = getState().explore[exploreId].modifiedQueries;
     const modifiedQueries = getState().explore[exploreId].modifiedQueries;
 
 
-    dispatch(importQueries(exploreId, modifiedQueries, currentDataSourceInstance, newDataSourceInstance));
+    await dispatch(importQueries(exploreId, modifiedQueries, currentDataSourceInstance, newDataSourceInstance));
+
     dispatch(updateDatasourceInstance(exploreId, newDataSourceInstance));
     dispatch(updateDatasourceInstance(exploreId, newDataSourceInstance));
     dispatch(loadDatasource(exploreId, newDataSourceInstance));
     dispatch(loadDatasource(exploreId, newDataSourceInstance));
   };
   };