Skip to content

Commit

Permalink
fix: sidebar headings don’t reset (#1591)
Browse files Browse the repository at this point in the history
* fix: useSidebar heading entries

* docs(changeset): fix: sidebar headings don’t reset

---------

Co-authored-by: Hans Pagel <mail@hanspagel.com>
  • Loading branch information
antlio and hanspagel committed May 6, 2024
1 parent 2ed588e commit f1bf5bc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/lazy-zebras-yell.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@scalar/api-reference": patch
---

fix: sidebar headings don’t reset
2 changes: 1 addition & 1 deletion packages/api-reference/src/hooks/useSidebar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ export function useSidebar(options?: { parsedSpec: Spec }) {
const description = parsedSpec.value?.info?.description

if (!description) {
return []
return (headings.value = [])
}

return (headings.value = await updateHeadings(description))
Expand Down

0 comments on commit f1bf5bc

Please sign in to comment.