Browse Source

Wait for queries to be imported before proceeding with datasource change

Dominik Prokop 7 năm trước cách đây
mục cha
commit
9ddbfed730
1 tập tin đã thay đổi với 2 bổ sung1 xóa
  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));
   };