From f129e0c411aac486786ad6261a38212c18ecb0e6 Mon Sep 17 00:00:00 2001 From: Ammar Ahmed Date: Mon, 1 Jun 2026 13:18:13 +0500 Subject: [PATCH] mobile: hide toc button if no headings in note --- .../editor-mobile/src/components/header.tsx | 40 +++++++++++-------- 1 file changed, 23 insertions(+), 17 deletions(-) diff --git a/packages/editor-mobile/src/components/header.tsx b/packages/editor-mobile/src/components/header.tsx index 718064a09..833a70449 100644 --- a/packages/editor-mobile/src/components/header.tsx +++ b/packages/editor-mobile/src/components/header.tsx @@ -139,6 +139,7 @@ function Header({ }): JSX.Element { const tab = useTabContext(); const editor = editors[tab.id]; + const tableOfContents = editorControllers[tab.id]?.getTableOfContents?.(); const insets = useSafeArea(); const openedTabsCount = useTabStore((state) => state.tabs.length); const [isOpen, setOpen] = useState(false); @@ -148,6 +149,8 @@ function Header({ state.canGoForward ]); + console.log(tableOfContents?.length); + return (
- - - - {strings.toc()} - - + + + {strings.toc()} + + + ) : null} +