Skip to content

Commit

Permalink
Merge pull request #12 from mitmedialab/maya-attempt-2
Browse files Browse the repository at this point in the history
language fix
  • Loading branch information
pmalacho-mit authored Jun 21, 2024
2 parents fbe8572 + 5cb5ebc commit e481396
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/containers/blocks.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,6 @@ class Blocks extends React.Component {
toolboxWorkspace.registerButtonCallback('MAKE_A_LIST', varListButtonCallback('list'));
toolboxWorkspace.registerButtonCallback('MAKE_A_PROCEDURE', procButtonCallback);
toolboxWorkspace.registerButtonCallback('CONNECT_MICROBIT_ROBOT', connectMicrobitRobotCallback);
this.props.vm.runtime.on(registerButtonCallbackEvent, (event) => {
toolboxWorkspace.registerButtonCallback(event, () => this.props.vm.runtime.emit(event));
});

this.props.vm.runtime.on(openUIEvent, (details) => this.props.onOpenProgrammaticModal(details));

Expand Down Expand Up @@ -228,7 +225,15 @@ class Blocks extends React.Component {
this.props.vm.refreshWorkspace();
this.requestToolboxUpdate();
this.withToolboxUpdates(() => {
this.workspace.getFlyout().setRecyclingEnabled(true);
this.flyout = this.workspace.getFlyout();
this.flyout.setRecyclingEnabled(true);

const registerButtonCallback = (event) =>
this.workspace.getFlyout()
? this.workspace.registerButtonCallback(event, () => { this.props.vm.runtime.emit(event) })
: this.props.vm.runtime.off(registerButtonCallbackEvent, registerButtonCallback)

this.props.vm.runtime.on(registerButtonCallbackEvent, registerButtonCallback.bind(this));
});
});
}
Expand Down

0 comments on commit e481396

Please sign in to comment.