Skip to content

Commit c0087f5

Browse files
committed
Fix DSE degree errors
1 parent f48186e commit c0087f5

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

components/privacy/button/index.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ const PrivacyButton = ({ href, children, ...rest }: PrivacyButtonProps) => {
1111
const { consent, open, init, initialized, showPopup, triggerShake } = usePrivacyStore()
1212
const hasConsent = consent === "accepted"
1313

14+
const isLinkEnabled = href && hasConsent
15+
1416
useEffect(() => {
1517
if (!initialized) init()
1618
}, [initialized, init])
@@ -27,7 +29,7 @@ const PrivacyButton = ({ href, children, ...rest }: PrivacyButtonProps) => {
2729
}
2830

2931
return (
30-
<Box as={hasConsent ? Link : Box} href={hasConsent ? href : undefined} onClick={handleClick} {...rest}>
32+
<Box as={isLinkEnabled ? Link : Box} href={isLinkEnabled ? href : undefined} onClick={handleClick} {...rest}>
3133
{children}
3234
</Box>
3335
)

pages/degrees/[slug].tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ const DegreePage = ({ degree, courses, admins, representatives, mainGroup }: Deg
4848
const t = useTranslations("degrees")
4949
const { fullName, color } = useDegree(degree.type, locale)
5050

51+
const filteredCourses = courses.filter((course) => !!course.course.group?.invite_link) // Filter courses that do not have a group associated
5152
const groupsLength = courses.length + (!!mainGroup ? 1 : 0)
5253

5354
return (
@@ -72,7 +73,7 @@ const DegreePage = ({ degree, courses, admins, representatives, mainGroup }: Deg
7273
<ItemList
7374
label={t("availableGroups")}
7475
sectionId={"groups"}
75-
items={courses}
76+
items={filteredCourses}
7677
enableSearch
7778
firstElement={
7879
mainGroup ? (

0 commit comments

Comments
 (0)