16672: Avoids log panel "blinking" when changing process view.
[arvados-workbench2.git] / src / store / process-panel / process-panel-actions.ts
index de114a3ec7467bdc195b8c8ed6c737e6b7f30442..962f5dfcf3b6a123aaaa3a7993ef7844bf77a39c 100644 (file)
@@ -13,6 +13,7 @@ import { snackbarActions } from 'store/snackbar/snackbar-actions';
 import { SnackbarKind } from '../snackbar/snackbar-actions';
 import { showWorkflowDetails } from 'store/workflow-panel/workflow-panel-actions';
 import { loadSubprocessPanel } from "../subprocess-panel/subprocess-panel-actions";
+import { initProcessLogsPanel, processLogsPanelActions } from "store/process-logs-panel/process-logs-panel-actions";
 
 export const processPanelActions = unionize({
     SET_PROCESS_PANEL_CONTAINER_REQUEST_UUID: ofType<string>(),
@@ -25,10 +26,12 @@ export type ProcessPanelAction = UnionOf<typeof processPanelActions>;
 export const toggleProcessPanelFilter = processPanelActions.TOGGLE_PROCESS_PANEL_FILTER;
 
 export const loadProcessPanel = (uuid: string) =>
-    (dispatch: Dispatch) => {
+    async (dispatch: Dispatch) => {
+        dispatch(processLogsPanelActions.RESET_PROCESS_LOGS_PANEL());
         dispatch<ProcessPanelAction>(processPanelActions.SET_PROCESS_PANEL_CONTAINER_REQUEST_UUID(uuid));
-        dispatch<any>(loadProcess(uuid));
+        await dispatch<any>(loadProcess(uuid));
         dispatch(initProcessPanelFilters);
+        dispatch<any>(initProcessLogsPanel(uuid));
         dispatch<any>(loadSubprocessPanel());
     };