mirror of
https://github.com/docmost/docmost.git
synced 2026-05-18 07:24:04 +08:00
fix(client): ensure sidebar remains visible on shared subpages (#1887)
* fix(client): ensure sidebar remains visible on shared subpages * Apply suggestions from code review Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
d2641db895
commit
4b105586a9
@@ -66,3 +66,20 @@ export function buildSharedPageTree(
|
||||
|
||||
return sortTree(tree);
|
||||
}
|
||||
|
||||
|
||||
// Recursively checks if a page exists in the shared page tree.
|
||||
export function isPageInTree(
|
||||
tree: SharedPageTreeNode[],
|
||||
pageSlugId: string,
|
||||
): boolean {
|
||||
for (const node of tree) {
|
||||
if (node.slugId === pageSlugId) {
|
||||
return true;
|
||||
}
|
||||
if (isPageInTree(node.children, pageSlugId)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user