Skip to content

Commit

Permalink
fix: docs TypeError (#544)
Browse files Browse the repository at this point in the history
  • Loading branch information
CDE90 committed Oct 2, 2022
1 parent 25454f1 commit 3c0b670
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions www/src/components/navigation/tableOfContents.astro
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ headings = [{ depth: 2, slug: "overview", text: title }, ...headings].filter(
const tocItem = Array.from(
document.querySelectorAll(`a[href="#${id}"]`),
).at(-1);
// this occurs when the id = "toc-heading"
if (!tocItem) return;
const func = entry.isIntersecting ? "add" : "remove";
tocItem.classList[func](
"font-medium",
Expand Down

1 comment on commit 3c0b670

@vercel
Copy link

@vercel vercel bot commented on 3c0b670 Oct 2, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.