Fix EditorModel clone to actually be useful

This commit is contained in:
Michael Telatynski 2021-10-12 11:02:06 +01:00
parent fe70e64a40
commit ddc408690c

View file

@ -91,7 +91,8 @@ export default class EditorModel {
}
public clone(): EditorModel {
return new EditorModel(this._parts, this._partCreator, this.updateCallback);
const clonedParts = this.parts.map(p => this.partCreator.deserializePart(p.serialize()));
return new EditorModel(clonedParts, this._partCreator, this.updateCallback);
}
private insertPart(index: number, part: Part): void {