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:
MATHEUS LUIS LORSCHEITER
2026-03-03 13:48:53 -03:00
committed by GitHub
parent d2641db895
commit 4b105586a9
2 changed files with 31 additions and 2 deletions
+17
View File
@@ -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;
}