From 373d571d9bd22413d94f20134fb4558df45906f6 Mon Sep 17 00:00:00 2001 From: chrisgarrity <chrisg@media.mit.edu> Date: Wed, 11 Jul 2018 09:01:24 -0400 Subject: [PATCH] refresh blocks after setLocale promise returns Depends on https://github.com/LLK/scratch-vm/pull/1321 --- src/containers/blocks.jsx | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/containers/blocks.jsx b/src/containers/blocks.jsx index 40ad9234e..982f8a566 100644 --- a/src/containers/blocks.jsx +++ b/src/containers/blocks.jsx @@ -148,11 +148,12 @@ class Blocks extends React.Component { setLocale () { this.workspace.getFlyout().setRecyclingEnabled(false); this.ScratchBlocks.ScratchMsgs.setLocale(this.props.locale); - this.props.vm.setLocale(this.props.locale, this.props.messages); - - this.workspace.updateToolbox(this.props.toolboxXML); - this.props.vm.refreshWorkspace(); - this.workspace.getFlyout().setRecyclingEnabled(true); + this.props.vm.setLocale(this.props.locale, this.props.messages) + .then(() => { + this.workspace.updateToolbox(this.props.toolboxXML); + this.props.vm.refreshWorkspace(); + this.workspace.getFlyout().setRecyclingEnabled(true); + }); } updateToolbox () { -- GitLab