diff --git a/src/virtual-machine.js b/src/virtual-machine.js index 12e6e7a77..90f87f740 100644 --- a/src/virtual-machine.js +++ b/src/virtual-machine.js @@ -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