fix: Hide TOC on templates

This commit is contained in:
Tom Moor
2024-11-27 18:20:49 -05:00
parent 29329daf15
commit ed25554607
2 changed files with 10 additions and 3 deletions
+3 -1
View File
@@ -412,7 +412,8 @@ class DocumentScene extends React.Component<Props> {
(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<Props> {
)}
{!isShare && !revision && (
<>
<p>test</p>
<MarkAsViewed document={document} />
<ReferencesWrapper>
<References document={document} />
+7 -2
View File
@@ -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 = (
<Tooltip
@@ -236,7 +237,11 @@ function DocumentHeader({
<TableOfContentsMenu />
) : (
<DocumentBreadcrumb document={document}>
{toc} <Star document={document} color={theme.textSecondary} />
{document.isTemplate ? null : (
<>
{toc} <Star document={document} color={theme.textSecondary} />
</>
)}
</DocumentBreadcrumb>
)
}