From ed2555460733a950c0ed346fc58c0ecac1fb4213 Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Wed, 27 Nov 2024 18:20:49 -0500 Subject: [PATCH] fix: Hide TOC on templates --- app/scenes/Document/components/Document.tsx | 4 +++- app/scenes/Document/components/Header.tsx | 9 +++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/app/scenes/Document/components/Document.tsx b/app/scenes/Document/components/Document.tsx index ef87755e99..384eebae24 100644 --- a/app/scenes/Document/components/Document.tsx +++ b/app/scenes/Document/components/Document.tsx @@ -412,7 +412,8 @@ class DocumentScene extends React.Component { (team && team.documentEmbeds === false) || document.embedsDisabled; const showContents = - ui.tocVisible === true || (isShare && ui.tocVisible !== false); + (ui.tocVisible === true && !document.isTemplate) || + (isShare && ui.tocVisible !== false); const tocPos = tocPosition ?? ((team?.getPreference(TeamPreference.TocPosition) as TOCPosition) || @@ -567,6 +568,7 @@ class DocumentScene extends React.Component { )} {!isShare && !revision && ( <> +

test

diff --git a/app/scenes/Document/components/Header.tsx b/app/scenes/Document/components/Header.tsx index cb9cec7668..39319b2e08 100644 --- a/app/scenes/Document/components/Header.tsx +++ b/app/scenes/Document/components/Header.tsx @@ -117,7 +117,8 @@ function DocumentHeader({ const canToggleEmbeds = team?.documentEmbeds; const isShare = !!shareId; const showContents = - ui.tocVisible === true || (isShare && ui.tocVisible !== false); + (ui.tocVisible === true && !document.isTemplate) || + (isShare && ui.tocVisible !== false); const toc = ( ) : ( - {toc} + {document.isTemplate ? null : ( + <> + {toc} + + )} ) }