Skip to content

Commit

Permalink
Redirect users to org page when there are no recent projects (#375)
Browse files Browse the repository at this point in the history
  • Loading branch information
chrishills authored Mar 10, 2024
1 parent 4255b2f commit 7cfbd62
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion apps/ui/src/views/router.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,10 @@ export const createRouter = ({
index: true,
loader: async () => {
const recents = getRecentProjects()
return recents.length && redirect(`projects/${recents[0].id}`)
if (recents.length) {
return redirect(`projects/${recents[0].id}`)
}
return redirect('organization')
},
element: <Projects />,
},
Expand Down

0 comments on commit 7cfbd62

Please sign in to comment.