Skip to content

Commit

Permalink
fix: close app redirect to '/' if no context route name given
Browse files Browse the repository at this point in the history
  • Loading branch information
kulmann committed Aug 16, 2022
1 parent 6b307b4 commit 0d079ed
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/web-pkg/src/components/AppTopBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ export default defineComponent({
name: 'AppTopBar',
props: {
resource: {
type: Object
type: Object,
default: null
}
}
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ export function useAppNavigation({
const navigateToContext = (context: MaybeRef<FileContext>) => {
const { fileName, routeName, routeParams, routeQuery } = unref(context)

if (!unref(routeName)) {
return router.push({ path: '/' })
}

return router.push({
name: unref(routeName),
params: unref(routeParams),
Expand Down

0 comments on commit 0d079ed

Please sign in to comment.