diff --git a/arches_references/src/arches_references/components/tree/ListTree.vue b/arches_references/src/arches_references/components/tree/ListTree.vue index 68f2004..6d4d909 100644 --- a/arches_references/src/arches_references/components/tree/ListTree.vue +++ b/arches_references/src/arches_references/components/tree/ListTree.vue @@ -65,16 +65,7 @@ const { setDisplayedRow } = inject(displayedRowKey) as unknown as { }; const route = useRoute(); -watch( - [ - () => { - return { ...route }; - }, - ], - ([newRoute]) => { - navigate(newRoute); - }, -); + const navigate = (newRoute: RouteLocationNormalizedLoadedGeneric) => { switch (newRoute.name) { case routeNames.splash: @@ -130,6 +121,18 @@ const navigate = (newRoute: RouteLocationNormalizedLoadedGeneric) => { } }; +// React to route changes. +watch( + [ + () => { + return { ...route }; + }, + ], + ([newRoute]) => { + navigate(newRoute); + }, +); + // Navigate on initial load of the tree. watch( tree,