From f6d419ae04d9fd6bbea3cc53bfd45b97a7baed1c Mon Sep 17 00:00:00 2001 From: Ray Schamp <ray@scratch.mit.edu> Date: Wed, 28 Nov 2018 11:24:43 -0500 Subject: [PATCH] Keep projects unchanged after loading --- src/lib/vm-manager-hoc.jsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/lib/vm-manager-hoc.jsx b/src/lib/vm-manager-hoc.jsx index d9efcd4de..76ea79658 100644 --- a/src/lib/vm-manager-hoc.jsx +++ b/src/lib/vm-manager-hoc.jsx @@ -54,7 +54,9 @@ const vmManagerHOC = function (WrappedComponent) { return this.props.vm.loadProject(this.props.projectData) .then(() => { this.props.onLoadedProject(this.props.loadingState, this.props.canSave); - this.props.onSetProjectUnchanged(); + // Wrap in a setTimeout because skin loading in + // the renderer can be async. + setTimeout(() => this.props.onSetProjectUnchanged()); // If the vm is not running, call draw on the renderer manually // This draws the state of the loaded project with no blocks running -- GitLab