ad1992 пре 3 година
родитељ
комит
1edde7291c
2 измењених фајлова са 2 додато и 5 уклоњено
  1. 1 5
      src/actions/actionFinalize.tsx
  2. 1 0
      src/data/restore.ts

+ 1 - 5
src/actions/actionFinalize.tsx

@@ -151,7 +151,6 @@ export const actionFinalize = register({
     } else {
     } else {
       activeTool.type = "selection";
       activeTool.type = "selection";
     }
     }
-
     return {
     return {
       elements: newElements,
       elements: newElements,
       appState: {
       appState: {
@@ -162,10 +161,7 @@ export const actionFinalize = register({
             appState.activeTool.type === "freedraw") &&
             appState.activeTool.type === "freedraw") &&
           multiPointElement
           multiPointElement
             ? appState.activeTool
             ? appState.activeTool
-            : {
-                ...appState.activeTool,
-                activeTool,
-              },
+            : activeTool,
         draggingElement: null,
         draggingElement: null,
         multiElement: null,
         multiElement: null,
         editingElement: null,
         editingElement: null,

+ 1 - 0
src/data/restore.ts

@@ -263,6 +263,7 @@ export const restoreAppState = (
   const activeTool: any = {
   const activeTool: any = {
     lastActiveToolBeforeEraser: null,
     lastActiveToolBeforeEraser: null,
     locked: nextAppState.activeTool.locked ?? false,
     locked: nextAppState.activeTool.locked ?? false,
+    type: "selection",
   };
   };
   if (AllowedExcalidrawActiveTools[nextAppState.activeTool.type]) {
   if (AllowedExcalidrawActiveTools[nextAppState.activeTool.type]) {
     if (nextAppState.activeTool.type === "custom") {
     if (nextAppState.activeTool.type === "custom") {