Skip to content

Commit

Permalink
fix: title is missing in the sidebar
Browse files Browse the repository at this point in the history
  • Loading branch information
Smnthjm08 committed Dec 7, 2024
1 parent ff3bda3 commit 1c36994
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/components/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -210,14 +210,16 @@ export function Sidebar({
{content.type === 'video' && <Play className="size-4" />}
{content.type === 'notion' && <File className="size-4" />}
</div>
<div>{content?.title}</div>
</div>
{content.type === 'video' && (
<BookmarkButton
bookmark={content.bookmark ?? null}
contentId={content.id}
/>
)}
</div>
/>
)}
</div>

</Link>
);
});
Expand Down

0 comments on commit 1c36994

Please sign in to comment.