Преглед на файлове

Wait for queries to be imported before proceeding with datasource change

Dominik Prokop преди 7 години
родител
ревизия
9ddbfed730
променени са 1 файла, в които са добавени 2 реда и са изтрити 1 реда
  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 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));
   };