17426: Fix stuck on loading screen.
[arvados-workbench2.git] / src / plugins / example / index.tsx
index b8bfcb0fa95cf10384410a4e54ca0164fd515277..6e2b1deedb2e6a36f205b3194d47d4947129afce 100644 (file)
@@ -18,6 +18,7 @@ import { DispatchProp, connect } from 'react-redux';
 import { MenuItem } from "@material-ui/core";
 import { propertiesActions } from '~/store/properties/properties-actions';
 import { Location } from 'history';
+import { handleFirstTimeLoad } from '~/store/workbench/workbench-actions';
 
 const categoryName = "Plugin Example";
 export const routePath = "/examplePlugin";
@@ -73,8 +74,11 @@ export const register = (pluginConfig: PluginConfig) => {
 
     pluginConfig.locationChangeHandlers.push((store: RootStore, pathname: string): boolean => {
         if (matchPath(pathname, { path: routePath, exact: true })) {
-            store.dispatch(activateSidePanelTreeItem(categoryName));
-            store.dispatch<any>(setSidePanelBreadcrumbs(categoryName));
+            store.dispatch(handleFirstTimeLoad(
+                (dispatch: Dispatch) => {
+                    dispatch<any>(activateSidePanelTreeItem(categoryName));
+                    dispatch<any>(setSidePanelBreadcrumbs(categoryName));
+                }));
             return true;
         }
         return false;