Shun Miyazawa пре 1 година
родитељ
комит
683aacc18a
1 измењених фајлова са 5 додато и 5 уклоњено
  1. 5 5
      apps/app/src/pages/[[...path]].page.tsx

+ 5 - 5
apps/app/src/pages/[[...path]].page.tsx

@@ -285,11 +285,11 @@ const Page: NextPageWithLayout<Props> = (props: Props) => {
 
 
   // initialize mutateEditingMarkdown only once per page
   // initialize mutateEditingMarkdown only once per page
   // need to include useCurrentPathname not useCurrentPagePath
   // need to include useCurrentPathname not useCurrentPagePath
-  // useEffect(() => {
-  //   if (props.currentPathname != null) {
-  //     mutateEditingMarkdown(props.yjsDraft ?? revisionBody);
-  //   }
-  // }, [mutateEditingMarkdown, revisionBody, props.currentPathname, props.yjsDraft]);
+  useEffect(() => {
+    if (props.currentPathname != null) {
+      mutateEditingMarkdown(revisionBody);
+    }
+  }, [mutateEditingMarkdown, revisionBody, props.currentPathname]);
 
 
   useEffect(() => {
   useEffect(() => {
     mutateRemoteRevisionId(pageWithMeta?.data.revision?._id);
     mutateRemoteRevisionId(pageWithMeta?.data.revision?._id);