From a5abdfeae53dc620da9b284169b1bc868ea99252 Mon Sep 17 00:00:00 2001
From: Karishma Chadha <kchadha@scratch.mit.edu>
Date: Tue, 24 Jul 2018 15:01:03 -0400
Subject: [PATCH] Clear the workspace undo when the workspace updates.

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

diff --git a/src/containers/blocks.jsx b/src/containers/blocks.jsx
index cd3d4ff53..3862fa653 100644
--- a/src/containers/blocks.jsx
+++ b/src/containers/blocks.jsx
@@ -310,6 +310,11 @@ class Blocks extends React.Component {
             this.workspace.scale = scale;
             this.workspace.resize();
         }
+
+        // Clear the undo state of the workspace since this is a
+        // fresh workspace and we don't want any changes made to another sprites
+        // workspace to be 'undone' here.
+        this.workspace.clearUndo();
     }
     handleExtensionAdded (blocksInfo) {
         // select JSON from each block info object then reject the pseudo-blocks which don't have JSON, like separators
-- 
GitLab