Skip to content
This repository has been archived by the owner on Jun 1, 2024. It is now read-only.

Commit

Permalink
whoops, courseSelector broke site for anon 🤦‍♂️
Browse files Browse the repository at this point in the history
  • Loading branch information
hcientist committed Mar 11, 2024
1 parent d630aa0 commit 887b471
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions components/courseSelector.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ function CourseSelector() {
</Spinner></Nav.Item>
}

// if they aren't logged in, or have no enrollments
if (enrollments && (enrollments.length === 0 || JSON.stringify(enrollments) === '{}')) {
return null;
}

// if the user has only one enrollment, don't show the dropdown
if (enrollments && enrollments.length === 1) {
return <Nav.Item><Link href={`/courses/${enrollments[0].course.slug}`} passHref>
Expand Down

0 comments on commit 887b471

Please sign in to comment.