#316: a possible fix for sentry #39

This commit is contained in:
SleepWalker 2017-04-19 21:06:08 +03:00
parent 876d3da4ab
commit c06b92be39

View File

@ -64,7 +64,7 @@ export default class LoggedInPanel extends Component {
onBodyClick = createOnOutsideComponentClickHandler(
() => ReactDOM.findDOMNode(this),
() => this.state.isAccountSwitcherActive,
() => this.state.isAccountSwitcherActive && this._isMounted,
() => this.toggleAccountSwitcher()
);
}
@ -78,6 +78,7 @@ export default class LoggedInPanel extends Component {
* @param {function} getEl - the function, that returns reference to container el
* @param {function} isActive - whether the component is active and callback may be called
* @param {function} callback - the callback to call, when there was a click outside el
*
* @return {function}
*/
function createOnOutsideComponentClickHandler(getEl, isActive, callback) {