From 36b54c533b6c088fd752ba64dcb932580966e02b Mon Sep 17 00:00:00 2001 From: arpitnath Date: Fri, 27 Oct 2023 16:49:43 +0530 Subject: [PATCH] Revert "multi-edit: ymap-fix-1" This reverts commit 8b799c3c51bc45179d2ad4ef405d6a234083d475. --- frontend/src/Editor/Editor.jsx | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/frontend/src/Editor/Editor.jsx b/frontend/src/Editor/Editor.jsx index e7fe57dd65..83a150eee3 100644 --- a/frontend/src/Editor/Editor.jsx +++ b/frontend/src/Editor/Editor.jsx @@ -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, }); }); };