Co-authored-by: kedar.netelixir <kedar.choudhary@netelixir.com> Co-authored-by: Danny Brown <danny.ri.brown@gmail.com>
This commit is contained in:
parent
36822cc6ce
commit
7d22bb7d5a
@ -136,12 +136,32 @@ class ToolbarRow extends Component {
|
||||
}
|
||||
|
||||
if (activeContextsChanged) {
|
||||
this.setState({
|
||||
toolbarButtons: _getVisibleToolbarButtons.call(this),
|
||||
});
|
||||
this.setState(
|
||||
{
|
||||
toolbarButtons: _getVisibleToolbarButtons.call(this),
|
||||
},
|
||||
this.closeCineDialogIfNotApplicable
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
closeCineDialogIfNotApplicable = () => {
|
||||
const { dialog } = this.props;
|
||||
let { dialogId, activeButtons, toolbarButtons } = this.state;
|
||||
if (dialogId) {
|
||||
const cineButtonPresent = toolbarButtons.find(
|
||||
button => button.options && button.options.behavior === 'CINE'
|
||||
);
|
||||
if (!cineButtonPresent) {
|
||||
dialog.dismiss({ id: dialogId });
|
||||
activeButtons = activeButtons.filter(
|
||||
button => button.options && button.options.behavior !== 'CINE'
|
||||
);
|
||||
this.setState({ dialogId: null, activeButtons });
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
render() {
|
||||
const buttonComponents = _getButtonComponents.call(
|
||||
this,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user