Yuken Tezuka 3 anni fa
parent
commit
4a0f995438

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

@@ -314,6 +314,7 @@ const Page: NextPageWithLayout<Props> = (props: Props) => {
     }
   }, [props.currentPathname, router]);
 
+  // initialize mutateEditingMarkdown only once per page
   useEffect(() => {
     mutateEditingMarkdown(pageWithMeta?.data.revision?.body);
   }, [mutateEditingMarkdown, pageWithMeta?.data.revision?.body]);

+ 2 - 0
packages/app/src/stores/editor.tsx

@@ -19,6 +19,8 @@ import { useStaticSWR } from './use-static-swr';
 
 
 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);