From: Peter Amstutz Date: Sat, 27 Feb 2021 22:20:26 +0000 (-0500) Subject: 17426: Fix stuck on loading screen. X-Git-Tag: 2.1.2.1~3^2~6 X-Git-Url: https://git.arvados.org/arvados-workbench2.git/commitdiff_plain/dd8c2373f5230831c051711d9e52a3b2defd9dd0 17426: Fix stuck on loading screen. Arvados-DCO-1.1-Signed-off-by: Peter Amstutz --- diff --git a/src/plugins/example/index.tsx b/src/plugins/example/index.tsx index b8bfcb0f..6e2b1dee 100644 --- a/src/plugins/example/index.tsx +++ b/src/plugins/example/index.tsx @@ -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(setSidePanelBreadcrumbs(categoryName)); + store.dispatch(handleFirstTimeLoad( + (dispatch: Dispatch) => { + dispatch(activateSidePanelTreeItem(categoryName)); + dispatch(setSidePanelBreadcrumbs(categoryName)); + })); return true; } return false; diff --git a/src/store/workbench/workbench-actions.ts b/src/store/workbench/workbench-actions.ts index 217c8524..8ea19a14 100644 --- a/src/store/workbench/workbench-actions.ts +++ b/src/store/workbench/workbench-actions.ts @@ -110,7 +110,7 @@ export const isWorkbenchLoading = (state: RootState) => { return progress ? progress.working : false; }; -const handleFirstTimeLoad = (action: any) => +export const handleFirstTimeLoad = (action: any) => async (dispatch: Dispatch, getState: () => RootState) => { try { await dispatch(action);