Backend of public sharing at root (#6103)

This commit is contained in:
Tom Moor
2023-11-01 22:10:00 -04:00
committed by GitHub
parent 1d6ef2e1b3
commit 2838503273
11 changed files with 153 additions and 29 deletions

View File

@@ -95,7 +95,7 @@ function SharedDocumentScene(props: Props) {
const [response, setResponse] = React.useState<Response>();
const [error, setError] = React.useState<Error | null | undefined>();
const { documents } = useStores();
const { shareId, documentSlug } = props.match.params;
const { shareId = env.ROOT_SHARE_ID, documentSlug } = props.match.params;
const documentId = useDocumentId(documentSlug, response);
const themeOverride = ["dark", "light"].includes(
searchParams.get("theme") || ""
@@ -185,7 +185,7 @@ function SharedDocumentScene(props: Props) {
title={response.document.title}
sidebar={
response.sharedTree?.children.length ? (
<Sidebar rootNode={response.sharedTree} shareId={shareId} />
<Sidebar rootNode={response.sharedTree} shareId={shareId!} />
) : undefined
}
>