Shun Miyazawa 3 years ago
parent
commit
2596c91f50

+ 1 - 0
packages/app/src/pages/[[...path]].page.tsx

@@ -283,6 +283,7 @@ const Page: NextPageWithLayout<Props> = (props: Props) => {
   }, [props.currentPathname, router]);
   }, [props.currentPathname, router]);
 
 
   // initialize mutateEditingMarkdown only once per page
   // initialize mutateEditingMarkdown only once per page
+  // need to include useCurrentPathname not useCurrentPagePath
   useEffect(() => {
   useEffect(() => {
     if (props.currentPathname != null) {
     if (props.currentPathname != null) {
       mutateEditingMarkdown(revisionBody);
       mutateEditingMarkdown(revisionBody);

+ 1 - 6
packages/app/src/stores/editor.tsx

@@ -10,7 +10,6 @@ import { IEditorSettings } from '~/interfaces/editor-settings';
 import { SlackChannels } from '~/interfaces/user-trigger-notification';
 import { SlackChannels } from '~/interfaces/user-trigger-notification';
 
 
 import {
 import {
-  useCurrentPathname,
   useCurrentUser, useDefaultIndentSize, useIsGuestUser,
   useCurrentUser, useDefaultIndentSize, useIsGuestUser,
 } from './context';
 } from './context';
 // import { localStorageMiddleware } from './middlewares/sync-to-storage';
 // import { localStorageMiddleware } from './middlewares/sync-to-storage';
@@ -19,11 +18,7 @@ import { useStaticSWR } from './use-static-swr';
 
 
 
 
 export const useEditingMarkdown = (initialData?: string): SWRResponse<string, Error> => {
 export const useEditingMarkdown = (initialData?: string): SWRResponse<string, Error> => {
-  // need to include useCurrentPathname not useCurrentPagePath
-  // https://github.com/weseek/growi/pull/7301
-  const { data: currentPagePath } = useCurrentPathname();
-
-  return useStaticSWR(['editingMarkdown', currentPagePath], initialData);
+  return useStaticSWR('editingMarkdown', initialData);
 };
 };