From 1c3699460a00d8f084b00c37fd781ee0820dd896 Mon Sep 17 00:00:00 2001 From: Smnthjm08 Date: Sat, 7 Dec 2024 12:08:46 +0530 Subject: [PATCH] fix: title is missing in the sidebar --- src/components/Sidebar.tsx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/components/Sidebar.tsx b/src/components/Sidebar.tsx index d3bf61eb..4f2c226d 100644 --- a/src/components/Sidebar.tsx +++ b/src/components/Sidebar.tsx @@ -108,7 +108,7 @@ export function Sidebar({ const courseUrlRegex = /\/courses\/\d+((?:\/\d+)+)/; if (urlRegex.test(pathName)) { - const matchArray = pathName.match(courseUrlRegex); + const matchArray = pathName?.match(courseUrlRegex); if (matchArray) { const currentUrlContentId = Number(matchArray[1].split('/')[1]); const pathArray = findPathToContent( @@ -210,14 +210,16 @@ export function Sidebar({ {content.type === 'video' && } {content.type === 'notion' && } +
{content?.title}
+ {content.type === 'video' && ( - )} - + /> + )} + ); });