Skip to content

Commit 9703bc6

Browse files
gonfunkocwillisf
authored andcommitted
refactor: improve efficiency of toolbox updates (#24)
1 parent 77c4e2f commit 9703bc6

File tree

1 file changed

+0
-13
lines changed

1 file changed

+0
-13
lines changed

packages/scratch-gui/src/containers/blocks.jsx

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -238,16 +238,6 @@ class Blocks extends React.Component {
238238
this.ScratchBlocks.hideChaff();
239239
}
240240

241-
// Only rerender the toolbox when the blocks are visible and the xml is
242-
// different from the previously rendered toolbox xml.
243-
// Do not check against prevProps.toolboxXML because that may not have been rendered.
244-
if (
245-
this.props.isVisible &&
246-
this.props.toolboxXML !== this._renderedToolboxXML
247-
) {
248-
this.requestToolboxUpdate();
249-
}
250-
251241
if (this.props.isVisible === prevProps.isVisible) {
252242
if (this.props.stageSize !== prevProps.stageSize) {
253243
// force workspace to redraw for the new stage size
@@ -269,7 +259,6 @@ class Blocks extends React.Component {
269259
this.setLocale();
270260
} else {
271261
this.props.vm.refreshWorkspace();
272-
this.requestToolboxUpdate();
273262
}
274263

275264
window.dispatchEvent(new Event("resize"));
@@ -298,7 +287,6 @@ class Blocks extends React.Component {
298287
.then(() => {
299288
this.workspace.getFlyout().setRecyclingEnabled(false);
300289
this.props.vm.refreshWorkspace();
301-
this.requestToolboxUpdate();
302290
this.withToolboxUpdates(() => {
303291
this.workspace.getFlyout().setRecyclingEnabled(true);
304292
});
@@ -744,7 +732,6 @@ class Blocks extends React.Component {
744732
)
745733
.then(() => {
746734
this.props.vm.refreshWorkspace();
747-
this.updateToolbox(); // To show new variables/custom blocks
748735
});
749736
}
750737
render() {

0 commit comments

Comments
 (0)