Revert "multi-edit: ymap-fix-1"

This reverts commit 8b799c3c51.
This commit is contained in:
arpitnath 2023-10-27 16:49:43 +05:30
parent fcedeaf6cb
commit 36b54c533b

View file

@ -227,13 +227,6 @@ const EditorComponent = (props) => {
prevAppDefinition.current = appDefinition;
}
const isYampUpdate = appDiffOptions?.skipAutoSave;
console.log('----arpit:: autoSave', { isYampUpdate });
if (isYampUpdate) {
return;
}
if (mounted && didAppDefinitionChanged && currentPageId) {
const components = appDefinition?.pages[currentPageId]?.components || {};
@ -359,7 +352,7 @@ const EditorComponent = (props) => {
if (!config.ENABLE_MULTIPLAYER_EDITING) return null;
// Observe changes in the 'appDef' property of the 'ymap' object
props.ymap?.observeDeep(() => {
props.ymap?.observe(() => {
const ymapUpdates = props.ymap?.get('appDef');
// Check if there is a new session and if others are on the same version and page
@ -372,15 +365,10 @@ const EditorComponent = (props) => {
if (isEqual(appDefinition, ymapUpdates.newDefinition)) return;
// Trigger real-time save with specific options
const shouldTransct = { editingVersion, ymapUpdates };
console.log('----arpit:: checking ymp', { shouldTransct });
realtimeSave(props.ymap?.get('appDef').newDefinition, {
skipAutoSave: true,
skipYmapUpdate: true,
currentSessionId: ymapUpdates.currentSessionId,
currentVersionId: ymapUpdates.editingVersionId,
});
});
};