fix(core): unable to create share page link (#5175)

For some reasons, our `spaceDoc.guid` and `page.id` may not necessarily be the same, so we switched to using the more accurate `page.id`.
This commit is contained in:
JimmFly
2023-12-05 07:21:18 +00:00
parent 1cd8de9d60
commit 1c88e1fb8b
2 changed files with 2 additions and 5 deletions

View File

@@ -73,10 +73,7 @@ const CloudShareMenu = (props: ShareMenuProps) => {
workspace: { id: workspaceId }, workspace: { id: workspaceId },
currentPage, currentPage,
} = props; } = props;
const { isSharedPage } = useIsSharedPage( const { isSharedPage } = useIsSharedPage(workspaceId, currentPage.id);
workspaceId,
currentPage.spaceDoc.guid
);
return ( return (
<Menu <Menu

View File

@@ -80,7 +80,7 @@ export const AffineSharePage = (props: ShareMenuProps) => {
changeShare, changeShare,
currentShareMode, currentShareMode,
disableShare, disableShare,
} = useIsSharedPage(workspaceId, currentPage.spaceDoc.guid); } = useIsSharedPage(workspaceId, currentPage.id);
const currentPageMode = useAtomValue(currentModeAtom); const currentPageMode = useAtomValue(currentModeAtom);
const defaultMode = useMemo(() => { const defaultMode = useMemo(() => {