From 33397c00cd4c6871ded820c5df82312fbe4b312b Mon Sep 17 00:00:00 2001
From: Ray Schamp <ray@scratch.mit.edu>
Date: Tue, 27 Sep 2016 15:42:02 -0400
Subject: [PATCH] Move rest of workspace/vm setup to VMManager

---
 src/components/gui.js | 1 -
 src/lib/vm-manager.js | 1 +
 2 files changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/components/gui.js b/src/components/gui.js
index 773156937..37b119d0e 100644
--- a/src/components/gui.js
+++ b/src/components/gui.js
@@ -22,7 +22,6 @@ class GUI extends React.Component {
     }
     onReceiveWorkspace (workspace) {
         this.workspace = workspace;
-        this.workspace.addChangeListener(this.props.vm.blockListener);
         VMManager.attachWorkspace(this.props.vm, this.workspace);
         VMManager.attachMouseEvents(this.props.vm, this.stage);
         VMManager.attachKeyboardEvents(this.props.vm);
diff --git a/src/lib/vm-manager.js b/src/lib/vm-manager.js
index 5014fcd17..e3991a5aa 100644
--- a/src/lib/vm-manager.js
+++ b/src/lib/vm-manager.js
@@ -2,6 +2,7 @@ const ScratchBlocks = require('scratch-blocks');
 
 module.exports = {
     attachWorkspace: function (vm, workspace) {
+        workspace.addChangeListener(vm.blockListener);
         vm.on('STACK_GLOW_ON', data => workspace.glowStack(data.id, true));
         vm.on('STACK_GLOW_OFF', data => workspace.glowStack(data.id, false));
         vm.on('BLOCK_GLOW_ON', data => workspace.glowBlock(data.id, true));
-- 
GitLab