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