|
|
@@ -55,7 +55,7 @@ import {
|
|
|
useHackmdUri,
|
|
|
useIsAclEnabled, useIsUserPage, useIsNotCreatable,
|
|
|
useCsrfToken, useIsSearchScopeChildrenAsDefault, useCurrentPageId, useCurrentPathname,
|
|
|
- useIsSlackConfigured, useIsBlinkedHeaderAtBoot, useRendererConfig, useCurrentMarkdown,
|
|
|
+ useIsSlackConfigured, useIsBlinkedHeaderAtBoot, useRendererConfig, useEditingMarkdown,
|
|
|
} from '../stores/context';
|
|
|
import { useXss } from '../stores/xss';
|
|
|
|
|
|
@@ -130,8 +130,6 @@ type Props = CommonProps & {
|
|
|
userUISettings: UserUISettingsDocument | null
|
|
|
// Sidebar
|
|
|
sidebarConfig: ISidebarConfig,
|
|
|
- // Markdown
|
|
|
- markdown: string,
|
|
|
};
|
|
|
|
|
|
const GrowiPage: NextPage<Props> = (props: Props) => {
|
|
|
@@ -175,7 +173,6 @@ const GrowiPage: NextPage<Props> = (props: Props) => {
|
|
|
// useIsAbleToDeleteCompletely(props.isAbleToDeleteCompletely);
|
|
|
useIsEnabledStaleNotification(props.isEnabledStaleNotification);
|
|
|
useIsBlinkedHeaderAtBoot(false);
|
|
|
- useCurrentMarkdown(props.markdown);
|
|
|
|
|
|
useIsSearchServiceConfigured(props.isSearchServiceConfigured);
|
|
|
useIsSearchServiceReachable(props.isSearchServiceReachable);
|
|
|
@@ -218,6 +215,7 @@ const GrowiPage: NextPage<Props> = (props: Props) => {
|
|
|
useIsNotCreatable(props.isForbidden || !isCreatablePage(pageWithMeta?.data.path ?? '')); // TODO: need to include props.isIdentical
|
|
|
useCurrentPagePath(pageWithMeta?.data.path);
|
|
|
useCurrentPathname(props.currentPathname);
|
|
|
+ useEditingMarkdown(pageWithMeta?.data.revision.body);
|
|
|
|
|
|
// sync pathname by Shallow Routing https://nextjs.org/docs/routing/shallow-routing
|
|
|
useEffect(() => {
|
|
|
@@ -519,9 +517,6 @@ export const getServerSideProps: GetServerSideProps = async(context: GetServerSi
|
|
|
const userUISettings = user == null ? null : await UserUISettings.findOne({ user: user._id }).exec();
|
|
|
props.userUISettings = JSON.parse(JSON.stringify(userUISettings));
|
|
|
|
|
|
- // Markdown
|
|
|
- props.markdown = pageWithMeta.revision.body;
|
|
|
-
|
|
|
return {
|
|
|
props,
|
|
|
};
|