Wrap event stoppage in null checks
Some of the code paths (particularly onFinished) do not have events, but the code paths we care about to prevent the room selection do have events - we can stop those without stopping further menus.
This commit is contained in:
parent
aa702514ce
commit
547690374e
1 changed files with 10 additions and 6 deletions
|
@ -160,9 +160,11 @@ export default class RoomTile2 extends React.Component<IProps, IState> {
|
|||
this.setState({notificationsMenuPosition: target.getBoundingClientRect()});
|
||||
};
|
||||
|
||||
private onCloseNotificationsMenu = (ev: InputEvent) => {
|
||||
ev.preventDefault();
|
||||
ev.stopPropagation();
|
||||
private onCloseNotificationsMenu = (ev?: InputEvent) => {
|
||||
if (ev) {
|
||||
ev.preventDefault();
|
||||
ev.stopPropagation();
|
||||
}
|
||||
this.setState({notificationsMenuPosition: null});
|
||||
};
|
||||
|
||||
|
@ -187,9 +189,11 @@ export default class RoomTile2 extends React.Component<IProps, IState> {
|
|||
});
|
||||
};
|
||||
|
||||
private onCloseGeneralMenu = (ev: InputEvent) => {
|
||||
ev.preventDefault();
|
||||
ev.stopPropagation();
|
||||
private onCloseGeneralMenu = (ev?: InputEvent) => {
|
||||
if (ev) {
|
||||
ev.preventDefault();
|
||||
ev.stopPropagation();
|
||||
}
|
||||
this.setState({generalMenuPosition: null});
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue