From 78d4fb5faad39c250248be1b7e37062c8bbae4bb Mon Sep 17 00:00:00 2001 From: arg3t Date: Thu, 31 Jul 2025 15:02:30 +0200 Subject: [PATCH] Disable ToC for encrypted notes --- quartz/components/TableOfContents.tsx | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/quartz/components/TableOfContents.tsx b/quartz/components/TableOfContents.tsx index f3dc9050f..8ed3f9f3f 100644 --- a/quartz/components/TableOfContents.tsx +++ b/quartz/components/TableOfContents.tsx @@ -25,7 +25,7 @@ export default ((opts?: Partial) => { displayClass, cfg, }: QuartzComponentProps) => { - if (!fileData.toc) { + if (!fileData.toc || fileData.encryptionResult) { return null } @@ -54,13 +54,14 @@ export default ((opts?: Partial) => { - {fileData.toc.map((tocEntry) => ( -
  • - - {tocEntry.text} - -
  • - ))} + {!fileData.encryptionResult && + fileData.toc.map((tocEntry) => ( +
  • + + {tocEntry.text} + +
  • + ))}
    )