fix(notify-button-clicked) Fix crash on mobile browsers

This commit is contained in:
hmuresan 2021-11-17 17:35:03 +02:00 committed by Horatiu Muresan
parent 2d0a70f2ab
commit 98b05a2529
1 changed files with 4 additions and 1 deletions

View File

@ -820,7 +820,10 @@ class Toolbox extends Component<Props> {
} }
Object.values(buttons).forEach((button: any) => { Object.values(buttons).forEach((button: any) => {
if (this.props._buttonsWithNotifyClick.includes(button.key)) { if (
typeof button === 'object'
&& this.props._buttonsWithNotifyClick.includes(button.key)
) {
button.handleClick = () => APP.API.notifyToolbarButtonClicked(button.key); button.handleClick = () => APP.API.notifyToolbarButtonClicked(button.key);
} }
}); });