From ed17ffe9627a5a65e9449a39afc2a4926cf254a7 Mon Sep 17 00:00:00 2001 From: Daniel Zhu Date: Sun, 15 Dec 2024 20:21:24 +0000 Subject: [PATCH 1/2] potential fix --- src/components/MarkdownLayout/NavBar.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/components/MarkdownLayout/NavBar.tsx b/src/components/MarkdownLayout/NavBar.tsx index 89b4a1c6ef..6a6f564531 100644 --- a/src/components/MarkdownLayout/NavBar.tsx +++ b/src/components/MarkdownLayout/NavBar.tsx @@ -24,10 +24,9 @@ const NavBar = ({ alignNavButtonsRight = true }) => { const moduleIdx = React.useMemo( () => sortedModuleLinks?.findIndex(x => x.id === markdownLayoutInfo.id), [markdownLayoutInfo, sortedModuleLinks] - ); + ) as number; if ( !sortedModuleLinks || - !moduleIdx || markdownLayoutInfo instanceof SolutionInfo ) { return null; From 1252a36f165b7e8d8928798dc0e445f38ab5ade8 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sun, 15 Dec 2024 20:23:10 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/components/MarkdownLayout/NavBar.tsx | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/components/MarkdownLayout/NavBar.tsx b/src/components/MarkdownLayout/NavBar.tsx index 6a6f564531..579366f1d4 100644 --- a/src/components/MarkdownLayout/NavBar.tsx +++ b/src/components/MarkdownLayout/NavBar.tsx @@ -25,10 +25,7 @@ const NavBar = ({ alignNavButtonsRight = true }) => { () => sortedModuleLinks?.findIndex(x => x.id === markdownLayoutInfo.id), [markdownLayoutInfo, sortedModuleLinks] ) as number; - if ( - !sortedModuleLinks || - markdownLayoutInfo instanceof SolutionInfo - ) { + if (!sortedModuleLinks || markdownLayoutInfo instanceof SolutionInfo) { return null; } const prevModule = moduleIdx === 0 ? null : sortedModuleLinks[moduleIdx - 1];