Better fix for EditorContext.clearGraph() text and graph sync
This commit is contained in:
@@ -194,10 +194,18 @@ export class EditorComponent implements OnInit, OnDestroy {
|
||||
|
||||
clearGraph() {
|
||||
self.selection = undefined;
|
||||
self.graphToTextSync = true;
|
||||
self.graph.clear();
|
||||
if (self.metamodel && self.metamodel.load && self.editor && self.editor.setDefaultContent) {
|
||||
return self.metamodel.load().then(data => self.editor.setDefaultContent(this, data));
|
||||
return self.metamodel.load().then(data => {
|
||||
self.editor.setDefaultContent(this, data);
|
||||
if (!self.graphToTextSync) {
|
||||
self.updateTextRepresentation();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
if (!self.graphToTextSync) {
|
||||
self.updateTextRepresentation();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user