From 6b6f5221ec3909a23934f3717d333e7415d26f92 Mon Sep 17 00:00:00 2001
From: Corey Frang <gnarf37@gmail.com>
Date: Fri, 13 Apr 2018 13:05:40 -0400
Subject: [PATCH] cleanup some stuff not for this branch

---
 src/containers/blocks.jsx | 14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)

diff --git a/src/containers/blocks.jsx b/src/containers/blocks.jsx
index 3aeffa851..c95576f73 100644
--- a/src/containers/blocks.jsx
+++ b/src/containers/blocks.jsx
@@ -223,19 +223,15 @@ class Blocks extends React.Component {
         // Remove and reattach the workspace listener (but allow flyout events)
         this.workspace.removeChangeListener(this.props.vm.blockListener);
         const dom = this.ScratchBlocks.Xml.textToDom(data.xml);
-        // @todo This line rerenders toolbox, and the change in the toolbox XML also rerenders the toolbox.
-        // We should only rerender the toolbox once. See https://github.com/LLK/scratch-gui/issues/901
         this.ScratchBlocks.Xml.clearWorkspaceAndLoadFromXml(dom, this.workspace);
         this.workspace.addChangeListener(this.props.vm.blockListener);
 
         if (this.props.vm.editingTarget && this.state.workspaceMetrics[this.props.vm.editingTarget.id]) {
-            setTimeout(() => {
-                const {scrollX, scrollY, scale} = this.state.workspaceMetrics[this.props.vm.editingTarget.id];
-                this.workspace.scrollX = scrollX;
-                this.workspace.scrollY = scrollY;
-                this.workspace.scale = scale;
-                this.workspace.resize();
-            }, 0);
+            const {scrollX, scrollY, scale} = this.state.workspaceMetrics[this.props.vm.editingTarget.id];
+            this.workspace.scrollX = scrollX;
+            this.workspace.scrollY = scrollY;
+            this.workspace.scale = scale;
+            this.workspace.resize();
         }
     }
     handleExtensionAdded (blocksInfo) {
-- 
GitLab