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

+ 2 - 2
apps/app/src/components/PageEditor.tsx

@@ -82,7 +82,7 @@ const PageEditor = React.memo((): JSX.Element => {
   const { data: currentPagePath } = useCurrentPagePath();
   const { data: currentPagePath } = useCurrentPagePath();
   const { data: currentPathname } = useCurrentPathname();
   const { data: currentPathname } = useCurrentPathname();
   const { data: currentPage } = useSWRxCurrentPage();
   const { data: currentPage } = useSWRxCurrentPage();
-  const { trigger: mutateCurrentPage } = useSWRMUTxCurrentPage();
+  const { data: mutatedCurrenPage, trigger: mutateCurrentPage } = useSWRMUTxCurrentPage();
   const { data: grantData, mutate: mutateGrant } = useSelectedGrant();
   const { data: grantData, mutate: mutateGrant } = useSelectedGrant();
   const { data: pageTags, sync: syncTagsInfoForEditor } = usePageTagsForEditors(pageId);
   const { data: pageTags, sync: syncTagsInfoForEditor } = usePageTagsForEditors(pageId);
   const { mutate: mutateTagsInfo } = useSWRxTagsInfo(pageId);
   const { mutate: mutateTagsInfo } = useSWRxTagsInfo(pageId);
@@ -110,7 +110,7 @@ const PageEditor = React.memo((): JSX.Element => {
 
 
   const updateStateAfterSave = useUpdateStateAfterSave(pageId, { supressEditingMarkdownMutation: true });
   const updateStateAfterSave = useUpdateStateAfterSave(pageId, { supressEditingMarkdownMutation: true });
 
 
-  const currentRevisionId = currentPage?.revision?._id;
+  const currentRevisionId = currentPage?.revision?._id || mutatedCurrenPage?.revision?._id;
 
 
   const initialValue = useMemo(() => {
   const initialValue = useMemo(() => {
     if (!isNotFound) {
     if (!isNotFound) {