diff --git a/src/containers/blocks.jsx b/src/containers/blocks.jsx index f64e7c30768639d0af1901590d6aba8947216a46..a3bf5872283fd3458ab45fce683f0bf0bdb370d2 100644 --- a/src/containers/blocks.jsx +++ b/src/containers/blocks.jsx @@ -170,13 +170,16 @@ 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) .then(() => { + this.workspace.getFlyout().setRecyclingEnabled(false); this.props.vm.refreshWorkspace(); - this.updateToolbox(); - this.workspace.getFlyout().setRecyclingEnabled(true); + // refreshWorkspace will cause a toolbox update + // wait for update to go through before reenabling recycling + this.withToolboxUpdates(() => { + this.workspace.getFlyout().setRecyclingEnabled(true); + }); }); }