|
|
@@ -44,6 +44,7 @@ import { mutatePageTree } from '~/stores/page-listing';
|
|
|
import { usePreviewOptions } from '~/stores/renderer';
|
|
|
import { useIsUntitledPage, useSelectedGrant } from '~/stores/ui';
|
|
|
import { useEditingUsers } from '~/stores/use-editing-users';
|
|
|
+import { useCurrentPageYjsData } from '~/stores/yjs';
|
|
|
import loggerFactory from '~/utils/logger';
|
|
|
|
|
|
import { EditorNavbar } from './EditorNavbar';
|
|
|
@@ -107,6 +108,7 @@ export const PageEditor = React.memo((props: Props): JSX.Element => {
|
|
|
const { data: editorSettings } = useEditorSettings();
|
|
|
const { mutate: mutateIsGrantNormalized } = useSWRxCurrentGrantData(currentPage?._id);
|
|
|
const { data: user } = useCurrentUser();
|
|
|
+ const { data: currentPageYjsData } = useCurrentPageYjsData();
|
|
|
const { onEditorsUpdated } = useEditingUsers();
|
|
|
const onConflict = useConflictResolver();
|
|
|
|
|
|
@@ -301,6 +303,9 @@ export const PageEditor = React.memo((props: Props): JSX.Element => {
|
|
|
// set handler to set caret line
|
|
|
useEffect(() => {
|
|
|
const handler = (lineNumber?: number) => {
|
|
|
+ if (currentPageYjsData?.hasRevisionBodyDiff) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
codeMirrorEditor?.setCaretLineInit(lineNumber);
|
|
|
};
|
|
|
globalEmitter.on('setCaretLine', handler);
|