Skip to content

Commit

Permalink
fixed /learn redirection
Browse files Browse the repository at this point in the history
  • Loading branch information
rgerum committed Jan 4, 2024
1 parent 46ae634 commit 8969b3e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/app/(stories)/learn/page.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ export default async function Page() {

if (session?.user) {
let last_course = await get_last_course(session?.user?.name);
redirect("/" + last_course.short);
if (last_course.length && last_course[0].short)
redirect("/" + last_course[0].short);
}

return <Welcome />;
Expand Down

0 comments on commit 8969b3e

Please sign in to comment.