From c06b92be395c372ec8584993aa2584808dc1df6c Mon Sep 17 00:00:00 2001 From: SleepWalker Date: Wed, 19 Apr 2017 21:06:08 +0300 Subject: [PATCH] #316: a possible fix for sentry #39 --- src/components/userbar/LoggedInPanel.jsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/userbar/LoggedInPanel.jsx b/src/components/userbar/LoggedInPanel.jsx index 5335cb2..adad7d5 100644 --- a/src/components/userbar/LoggedInPanel.jsx +++ b/src/components/userbar/LoggedInPanel.jsx @@ -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) {