Yuken Tezuka 3 лет назад
Родитель
Сommit
d4149a679f
1 измененных файлов с 2 добавлено и 3 удалено
  1. 2 3
      packages/app/src/components/PageEditor/ConflictDiffModal.tsx

+ 2 - 3
packages/app/src/components/PageEditor/ConflictDiffModal.tsx

@@ -18,7 +18,6 @@ import { useCurrentPagePath, useSWRxCurrentPage } from '~/stores/page';
 import {
   useRemoteRevisionBody, useRemoteRevisionId, useRemoteRevisionLastUpdatedAt, useRemoteRevisionLastUpdateUser, useSetRemoteLatestPageData,
 } from '~/stores/remote-latest-page';
-import { useEditorMode } from '~/stores/ui';
 
 import { IRevisionOnConflict } from '../../interfaces/revision';
 import ExpandOrContractButton from '../ExpandOrContractButton';
@@ -98,16 +97,16 @@ const ConflictDiffModalCore = (props: ConflictDiffModalCoreProps): JSX.Element =
   }, [onClose]);
 
   const onResolveConflict = useCallback(async() => {
+    if (currentPathname == null) { return }
     // disable button after clicked
     setIsRevisionSelected(false);
 
     const codeMirrorVal = uncontrolledRef.current?.editor.doc.getValue();
 
     try {
-      // TODO: consider using saveOrUpdate or create new method
       const { page } = await saveOrUpdate(
         codeMirrorVal,
-        { pageId, path: currentPagePath || currentPathname || '', revisionId: remoteRevisionId },
+        { pageId, path: currentPagePath || currentPathname, revisionId: remoteRevisionId },
         optionsToSave,
       );
       const remotePageData = {