Browse Source

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

pull/9321/head
David Luzar 9 months ago committed by GitHub
parent
commit
d797c2e210
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 8
      packages/excalidraw/data/restore.ts

8
packages/excalidraw/data/restore.ts

@ -221,7 +221,7 @@ const restoreElementWithProperties = < @@ -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 = < @@ -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 = (

Loading…
Cancel
Save