|
@@ -57,7 +57,7 @@ import DisplaySwitcher from '../components/Page/DisplaySwitcher';
|
|
|
// import PageStatusAlert from '../client/js/components/PageStatusAlert';
|
|
// import PageStatusAlert from '../client/js/components/PageStatusAlert';
|
|
|
import {
|
|
import {
|
|
|
useCurrentUser,
|
|
useCurrentUser,
|
|
|
- useIsLatestRevision, useCurrentRevisionId,
|
|
|
|
|
|
|
+ useIsLatestRevision,
|
|
|
useIsForbidden, useIsNotFound, useIsSharedUser,
|
|
useIsForbidden, useIsNotFound, useIsSharedUser,
|
|
|
useIsEnabledStaleNotification, useIsIdenticalPath,
|
|
useIsEnabledStaleNotification, useIsIdenticalPath,
|
|
|
useIsSearchServiceConfigured, useIsSearchServiceReachable, useDisableLinkSharing,
|
|
useIsSearchServiceConfigured, useIsSearchServiceReachable, useDisableLinkSharing,
|
|
@@ -136,7 +136,6 @@ type Props = CommonProps & {
|
|
|
|
|
|
|
|
// shareLinkId?: string;
|
|
// shareLinkId?: string;
|
|
|
isLatestRevision?: boolean,
|
|
isLatestRevision?: boolean,
|
|
|
- currentRevisionId?: string,
|
|
|
|
|
|
|
|
|
|
isIdenticalPathPage?: boolean,
|
|
isIdenticalPathPage?: boolean,
|
|
|
isForbidden: boolean,
|
|
isForbidden: boolean,
|
|
@@ -248,7 +247,6 @@ const GrowiPage: NextPage<Props> = (props: Props) => {
|
|
|
useCurrentPageId(pageId ?? null);
|
|
useCurrentPageId(pageId ?? null);
|
|
|
// useIsNotCreatable(props.isForbidden || !isCreatablePage(pagePath)); // TODO: need to include props.isIdentical
|
|
// useIsNotCreatable(props.isForbidden || !isCreatablePage(pagePath)); // TODO: need to include props.isIdentical
|
|
|
useCurrentPathname(props.currentPathname);
|
|
useCurrentPathname(props.currentPathname);
|
|
|
- useCurrentRevisionId(props.currentRevisionId);
|
|
|
|
|
|
|
|
|
|
const { data: currentPage } = useSWRxCurrentPage(undefined, pageWithMeta?.data ?? null); // store initial data
|
|
const { data: currentPage } = useSWRxCurrentPage(undefined, pageWithMeta?.data ?? null); // store initial data
|
|
|
useEditingMarkdown(pageWithMeta?.data.revision?.body ?? props.templateBodyData ?? '');
|
|
useEditingMarkdown(pageWithMeta?.data.revision?.body ?? props.templateBodyData ?? '');
|
|
@@ -424,10 +422,6 @@ async function injectPageData(context: GetServerSidePropsContext, props: Props):
|
|
|
props.isLatestRevision = page.isLatestRevision();
|
|
props.isLatestRevision = page.isLatestRevision();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- if (typeof revisionId === 'string' || typeof revisionId === 'undefined') {
|
|
|
|
|
- props.currentRevisionId = props.isLatestRevision && page.latestRevision != null ? page.latestRevision.toString() : revisionId;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
if (page == null && user != null) {
|
|
if (page == null && user != null) {
|
|
|
const templateData = await Page.findTemplate(props.currentPathname);
|
|
const templateData = await Page.findTemplate(props.currentPathname);
|
|
|
if (templateData != null) {
|
|
if (templateData != null) {
|