From 649d2fff0f4633cafc276f40caf2439054d282ea Mon Sep 17 00:00:00 2001
From: Dorian Koch <doriank@fsmpi.rwth-aachen.de>
Date: Wed, 11 Sep 2024 14:49:46 +0200
Subject: [PATCH] Fix show only public courses

---
 src/pages/courses.tsx | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/pages/courses.tsx b/src/pages/courses.tsx
index e22b3f6..685a2e8 100644
--- a/src/pages/courses.tsx
+++ b/src/pages/courses.tsx
@@ -103,10 +103,11 @@ function CourseGroupCard({
                         {g.list.flatMap((c) => {
                             if (
                                 onlyShowPublicCourses &&
-                                !c.default_authentication_methods?.includes("public")
+                                (!c.default_authentication_methods?.includes("public") ||
+                                    c.is_visible === false)
                             ) {
-                                // I chose not to check c.is_visible or c.is_listed here because
-                                // it may be useful for videoag admins to check which courses are falsely set to public
+                                // I chose not to check c.is_listed here because
+                                // it may be useful for videoag admins to check which courses are falsely set to visible and public
                                 return [];
                             }
                             return [
-- 
GitLab