浏览代码

fix: strip legacy attrs on element restore (#9318)

David Luzar 7 月之前
父节点
当前提交
d797c2e210
共有 1 个文件被更改,包括 7 次插入1 次删除
  1. 7 1
      packages/excalidraw/data/restore.ts

+ 7 - 1
packages/excalidraw/data/restore.ts

@@ -221,7 +221,7 @@ const restoreElementWithProperties = <
       "customData" in extra ? extra.customData : element.customData;
   }
 
-  return {
+  const ret = {
     // spread the original element properties to not lose unknown ones
     // for forward-compatibility
     ...element,
@@ -230,6 +230,12 @@ const restoreElementWithProperties = <
     ...getNormalizedDimensions(base),
     ...extra,
   } as unknown as T;
+
+  // strip legacy props (migrated in previous steps)
+  delete ret.strokeSharpness;
+  delete ret.boundElementIds;
+
+  return ret;
 };
 
 const restoreElement = (