From 4fae0886260426add3527bee37f81b65e1e1fc03 Mon Sep 17 00:00:00 2001 From: Rotimi Best Date: Wed, 19 Aug 2026 13:24:20 +0100 Subject: [PATCH] fix(course): stop mobile sidebar crash when path is undefined (#934) The course layout treated `path` as a SvelteKit prop, but parents never pass it. CourseMobileBottomNav then called isContentItemInPath with undefined, which crashed on `.split()` and prevented the mobile sidebar from opening. Use page.url.pathname and guard missing paths. --- .../mobile/course-mobile-bottom-nav.svelte | 12 ++++---- .../course/utils/content-navigation.test.ts | 28 +++++++++++++++++ .../course/utils/content-navigation.ts | 30 ++++++++++++++----- .../routes/(app)/courses/[id]/+layout.svelte | 8 ++--- 4 files changed, 62 insertions(+), 16 deletions(-) create mode 100644 apps/dashboard/src/lib/features/course/utils/content-navigation.test.ts diff --git a/apps/dashboard/src/lib/features/course/components/mobile/course-mobile-bottom-nav.svelte b/apps/dashboard/src/lib/features/course/components/mobile/course-mobile-bottom-nav.svelte index b7e8a8c3..7eb1e5a2 100644 --- a/apps/dashboard/src/lib/features/course/components/mobile/course-mobile-bottom-nav.svelte +++ b/apps/dashboard/src/lib/features/course/components/mobile/course-mobile-bottom-nav.svelte @@ -1,6 +1,7 @@