Skip to content

Build your personal knowledge base with Trilium Notes

fix(client/ts): regression in table of contents

Elian Doran64654290be68
diff --git a/src/public/app/widgets/toc.ts b/src/public/app/widgets/toc.ts
index e65b807c1a..20fdde57e9 100644
--- a/src/public/app/widgets/toc.ts
+++ b/src/public/app/widgets/toc.ts
@@ -132,10 +132,9 @@ export default class TocWidget extends RightPanelWidget {
}
}
+ this.$toc.empty();
if ($toc) {
this.$toc.append($toc);
- } else {
- this.$toc.empty();
}
if (["", "show"].includes(tocLabel?.value ?? "") || headingCount >= (options.getInt("minTocHeadings") ?? 0)) {