Avoid double toolbox update when setting the locale
This commit is contained in:
1 parent
ef59643c94
commit
cf0d5487d6
1 file changed
+6
-3
@@ -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);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user