From 5d6a48a24b85d088afcdd1b4dfff04eea0037fc1 Mon Sep 17 00:00:00 2001 From: Karishma Chadha <kchadha@scratch.mit.edu> Date: Thu, 19 Jul 2018 15:17:27 -0400 Subject: [PATCH] Call updateToolbox whenever the blocks container updates and is visible so that changes to dynamic menus (e.g. costume renaming) are picked up. Update setLocale to call updateToolbox so that the toolboxRefresh gets re-enabled. This is needed for getting translated toolbox strings like 'Hello' and 'Hmmm...' to stay in sync with language changes. --- src/containers/blocks.jsx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/containers/blocks.jsx b/src/containers/blocks.jsx index 2ea34d220..cd3d4ff53 100644 --- a/src/containers/blocks.jsx +++ b/src/containers/blocks.jsx @@ -145,10 +145,9 @@ class Blocks extends React.Component { this.setLocale(); } else { this.props.vm.refreshWorkspace(); + this.updateToolbox(); } - // Re-enable toolbox refreshes without causing one. See #updateToolbox for more info. - this.workspace.toolboxRefreshEnabled_ = true; window.dispatchEvent(new Event('resize')); } else { this.workspace.setVisible(false); @@ -165,8 +164,8 @@ class Blocks extends React.Component { this.ScratchBlocks.ScratchMsgs.setLocale(this.props.locale); this.props.vm.setLocale(this.props.locale, this.props.messages) .then(() => { - this.workspace.updateToolbox(this.props.toolboxXML); this.props.vm.refreshWorkspace(); + this.updateToolbox(); this.workspace.getFlyout().setRecyclingEnabled(true); }); } -- GitLab