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) {
|
if (activeContextsChanged) {
|
||||||
this.setState({
|
this.setState(
|
||||||
toolbarButtons: _getVisibleToolbarButtons.call(this),
|
{
|
||||||
});
|
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() {
|
render() {
|
||||||
const buttonComponents = _getButtonComponents.call(
|
const buttonComponents = _getButtonComponents.call(
|
||||||
this,
|
this,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user