add ability to refresh workspace for current editing target

This commit is contained in:
DD Liu 2017-06-15 11:53:30 -04:00
parent 93bac9ad85
commit 2fb502fb70

View file

@ -469,6 +469,17 @@ class VirtualMachine extends EventEmitter {
}
}
/**
* Repopulate the workspace with the blocks of the current editingTarget. This
* allows us to get around bugs like gui#413.
*/
refreshWorkspace () {
if (this.editingTarget) {
this.emitWorkspaceUpdate();
this.runtime.setEditingTarget(this.editingTarget);
}
}
/**
* Emit metadata about available targets.
* An editor UI could use this to display a list of targets and show