Skip to content

Build your personal knowledge base with Trilium Notes

fix(toc): not hiding if too few headings

Elian Dorana98ed6cd2914
diff --git a/src/public/app/widgets/toc.ts b/src/public/app/widgets/toc.ts
index 20fdde57e9..a232fe6ce8 100644
--- a/src/public/app/widgets/toc.ts
+++ b/src/public/app/widgets/toc.ts
@@ -137,7 +137,7 @@ export default class TocWidget extends RightPanelWidget {
this.$toc.append($toc);
}
- if (["", "show"].includes(tocLabel?.value ?? "") || headingCount >= (options.getInt("minTocHeadings") ?? 0)) {
+ if ((tocLabel?.value === "" || tocLabel?.value === "show") || headingCount >= (options.getInt("minTocHeadings") ?? 0)) {
this.toggleInt(true);
this.noteContext.viewScope.tocPreviousVisible = true;
} else {