X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/20844fff7469abc3caaf0e14c05741e0acc62611..623f5deee7b203090fb71f028e01ed55e0f8a38c:/src/routes/route-change-handlers.ts diff --git a/src/routes/route-change-handlers.ts b/src/routes/route-change-handlers.ts index 400ddc88..8a66e420 100644 --- a/src/routes/route-change-handlers.ts +++ b/src/routes/route-change-handlers.ts @@ -10,6 +10,7 @@ import { navigateToRootProject } from '~/store/navigation/navigation-action'; import { dialogActions } from '~/store/dialog/dialog-actions'; import { contextMenuActions } from '~/store/context-menu/context-menu-actions'; import { searchBarActions } from '~/store/search-bar/search-bar-actions'; +import { pluginConfig } from '~/plugins'; export const addRouteChangeHandlers = (history: History, store: RootStore) => { const handler = handleLocationChange(store); @@ -53,6 +54,12 @@ const handleLocationChange = (store: RootStore) => ({ pathname }: Location) => { store.dispatch(contextMenuActions.CLOSE_CONTEXT_MENU()); store.dispatch(searchBarActions.CLOSE_SEARCH_VIEW()); + for (const locChangeFn of pluginConfig.locationChangeHandlers) { + if (locChangeFn(store, pathname)) { + return; + } + } + if (projectMatch) { store.dispatch(WorkbenchActions.loadProject(projectMatch.params.id)); } else if (collectionMatch) { @@ -112,4 +119,4 @@ const handleLocationChange = (store: RootStore) => ({ pathname }: Location) => { } else if (allProcessesMatch) { store.dispatch(WorkbenchActions.loadAllProcesses()); } -}; \ No newline at end of file +};