mirror of
https://github.com/element-hq/element-web
synced 2024-11-29 04:48:50 +03:00
Nest ifs to avoid unnecessary work
This commit is contained in:
parent
e059a08d7b
commit
f4c073ad45
1 changed files with 6 additions and 7 deletions
|
@ -259,16 +259,15 @@ const LoggedInView = React.createClass({
|
||||||
// When the panels are disabled, clicking on them results in a mouse event
|
// When the panels are disabled, clicking on them results in a mouse event
|
||||||
// which bubbles to certain elements in the tree. When this happens, close
|
// which bubbles to certain elements in the tree. When this happens, close
|
||||||
// any settings page that is currently open (user/room/group).
|
// any settings page that is currently open (user/room/group).
|
||||||
const targetClasses = new Set(ev.target.className.split(' '));
|
if (this.props.leftDisabled && this.props.rightDisabled) {
|
||||||
if (this.props.leftDisabled &&
|
const targetClasses = new Set(ev.target.className.split(' '));
|
||||||
this.props.rightDisabled &&
|
if (
|
||||||
(
|
|
||||||
targetClasses.has('mx_MatrixChat') ||
|
targetClasses.has('mx_MatrixChat') ||
|
||||||
targetClasses.has('mx_MatrixChat_middlePanel') ||
|
targetClasses.has('mx_MatrixChat_middlePanel') ||
|
||||||
targetClasses.has('mx_RoomView')
|
targetClasses.has('mx_RoomView')
|
||||||
)
|
) {
|
||||||
) {
|
dis.dispatch({ action: 'close_settings' });
|
||||||
dis.dispatch({ action: 'close_settings' });
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue