浏览代码

use commitToHistory prop for handling draw history (#1595)

David Luzar 5 年之前
父节点
当前提交
828c9c4d65
共有 2 个文件被更改,包括 1 次插入2 次删除
  1. 1 1
      src/actions/actionFinalize.tsx
  2. 0 1
      src/components/App.tsx

+ 1 - 1
src/actions/actionFinalize.tsx

@@ -89,7 +89,7 @@ export const actionFinalize = register({
               }
             : appState.selectedElementIds,
       },
-      commitToHistory: false,
+      commitToHistory: appState.elementType === "draw",
     };
   },
   keyTest: (event, appState) =>

+ 0 - 1
src/components/App.tsx

@@ -2340,7 +2340,6 @@ class App extends React.Component<any, AppState> {
 
       if (draggingElement?.type === "draw") {
         this.actionManager.executeAction(actionFinalize);
-        history.resumeRecording();
         return;
       }
       if (isLinearElement(draggingElement)) {