Shun Miyazawa 2 лет назад
Родитель
Сommit
7a1bdfface
1 измененных файлов с 3 добавлено и 0 удалено
  1. 3 0
      apps/app/src/components/PageEditor.tsx

+ 3 - 0
apps/app/src/components/PageEditor.tsx

@@ -324,6 +324,7 @@ const PageEditor = React.memo((): JSX.Element => {
       editorRef.current.insertText(insertText);
 
       // when if created newly
+      // Not using 'mutateGrant' to inherit the grant of the parent page
       if (res.pageCreated) {
         logger.info('Page is created', res.page._id);
         setIsPageCreatedWithAttachmentUpload(true);
@@ -521,6 +522,8 @@ const PageEditor = React.memo((): JSX.Element => {
 
   // when transitioning to a different page, if the initialValue is the same,
   // UnControlled CodeMirror value does not reset, so explicitly set the value to initialValue
+  // Also, if an attachment is uploaded and a new page is created,
+  // "useCurrentPagePath" changes, but no page transition is made, so nothing is done.
   useEffect(() => {
     if (currentPagePath != null && !isPageCreatedWithAttachmentUpload) {
       editorRef.current?.setValue(initialValue);