mirror of
https://github.com/streetwriters/notesnook.git
synced 2026-08-29 10:09:26 +02:00
Merge pull request #9922 from streetwriters/fix/400
mobile: hide toc button if no headings in editor
This commit is contained in:
@@ -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 (
|
||||
<div
|
||||
style={{
|
||||
@@ -496,6 +499,7 @@ function Header({
|
||||
</span>
|
||||
</MenuItem>
|
||||
|
||||
{tableOfContents?.length ? (
|
||||
<MenuItem
|
||||
value="toc"
|
||||
style={{
|
||||
@@ -516,6 +520,8 @@ function Header({
|
||||
{strings.toc()}
|
||||
</span>
|
||||
</MenuItem>
|
||||
) : null}
|
||||
|
||||
<MenuItem
|
||||
value="scroll-top"
|
||||
style={{
|
||||
|
||||
Reference in New Issue
Block a user