feat: add homeApp to redirect / to the dashboard#8
Conversation
src/homeApp.tsx
Outdated
| if (dashboardUrl) { | ||
| return <Navigate to={dashboardUrl} replace />; | ||
| } | ||
| return null; |
There was a problem hiding this comment.
If there's no dashboard for any kind of reason, wouldn't it be better to lead them to a 404?
There was a problem hiding this comment.
Good point. That is exactly what's going to happen since we merged openedx/frontend-base#194: there's no default '/' route. 👍🏼
There was a problem hiding this comment.
(Or, at least, that's what should happen given the config.)
There was a problem hiding this comment.
but that PR uses useRouteError right? which is expecting an error so the error boundary does it's magic, and in this case we return null here when there's no dashboardUrl and the getUrlByRouteRole it's going to return either the route for a frontend base component or an external route or null
which means there's a case we just sho a null component with no error right?
There was a problem hiding this comment.
You're completely right. Obviously (in retrospect), we need to throw the error, otherwise the boundary won't catch it. Fixed!
Adds an inline app that redirects the root route to the learner dashboard via getUrlByRouteRole, shared across dev and build configs. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
84f3400 to
c3afa19
Compare
Description
Add an inline homeApp that registers a route at
/and redirects to the learner dashboard viagetUrlByRouteRole, shared across both dev and build site configs. If the dashboard role isn't found, nothing is rendered.LLM usage notice
Built with assistance from Claude models (mostly Opus 4.6).