Skip to content

Commit

Permalink
Fixed #1532 slowing performance on debug mode (#1558)
Browse files Browse the repository at this point in the history
  • Loading branch information
MV88 authored and offtherailz committed Mar 14, 2017
1 parent 96c6e6a commit 046df65
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions web/client/actions/security.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ function logout(redirectUrl) {
};
}

function logoutWithReload(redirectUrl) {
function logoutWithReload() {
return (dispatch) => {
dispatch(logout(redirectUrl));
dispatch(logout(null));
dispatch(loadMaps(false, ConfigUtils.getDefaults().initialMapFilter || "*"));
};
}
Expand Down
2 changes: 1 addition & 1 deletion web/client/plugins/drawer/Menu.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ var Menu = React.createClass({
},
renderButtons() {
return this.props.children.map((child) => {
const button = (<Button key={child.props.eventKey} bsSize="large" className={(child.props.buttonConfig && child.props.buttonConfig.buttonClassName) ? child.props.buttonConfig.buttonClassName : "square-button"} onClick={this.props.onChoose.bind(null, child.props.eventKey)} bsStyle={this.props.activeKey === child.props.eventKey ? 'default' : 'primary'}>
const button = (<Button key={child.props.eventKey} bsSize="large" className={(child.props.buttonConfig && child.props.buttonConfig.buttonClassName) ? child.props.buttonConfig.buttonClassName : "square-button"} onClick={this.props.onChoose.bind(null, child.props.eventKey, this.props.activeKey === child.props.eventKey)} bsStyle={this.props.activeKey === child.props.eventKey ? 'default' : 'primary'}>
{child.props.glyph ? <Glyphicon glyph={child.props.glyph} /> : child.props.icon}
</Button>);
if (child.props.buttonConfig.tooltip) {
Expand Down
20 changes: 10 additions & 10 deletions web/client/plugins/login/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,41 +13,41 @@ const {Glyphicon} = require('react-bootstrap');

const closeLogin = () => {
return (dispatch) => {
dispatch(setControlProperty('LoginForm', 'enabled', false));
dispatch(setControlProperty(null, 'LoginForm', 'enabled', false, false));
dispatch(resetError());
};
};

const UserMenu = connect((state) => ({
user: state.security && state.security.user
}), {
onShowLogin: setControlProperty.bind(null, "LoginForm", "enabled", true),
onShowAccountInfo: setControlProperty.bind(null, "AccountInfo", "enabled", true),
onShowChangePassword: setControlProperty.bind(null, "ResetPassword", "enabled", true),
onShowLogin: setControlProperty.bind(null, "LoginForm", "enabled", true, true),
onShowAccountInfo: setControlProperty.bind(null, "AccountInfo", "enabled", true, true),
onShowChangePassword: setControlProperty.bind(null, "ResetPassword", "enabled", true, true),
onLogout: logoutWithReload
})(require('../../components/security/UserMenu'));

const UserDetails = connect((state) => ({
user: state.security && state.security.user,
show: state.controls.AccountInfo && state.controls.AccountInfo.enabled}
), {
onClose: setControlProperty.bind(null, "AccountInfo", "enabled", false)
onClose: setControlProperty.bind(null, "AccountInfo", "enabled", false, false)
})(require('../../components/security/modals/UserDetailsModal'));

const PasswordReset = connect((state) => ({
user: state.security && state.security.user,
show: state.controls.ResetPassword && state.controls.ResetPassword.enabled
}), {
onPasswordChange: (user, pass) => { return geoStoreChangePassword(user, pass); },
onClose: setControlProperty.bind(null, "ResetPassword", "enabled", false)
onClose: setControlProperty.bind(null, "ResetPassword", "enabled", false, false)
})(require('../../components/security/modals/PasswordResetModal'));

const Login = connect((state) => ({
show: state.controls.LoginForm && state.controls.LoginForm.enabled,
user: state.security && state.security.user,
loginError: state.security && state.security.loginError
}), {
onLoginSuccess: setControlProperty.bind(null, 'LoginForm', 'enabled', false),
onLoginSuccess: setControlProperty.bind(null, 'LoginForm', 'enabled', false, false),
onClose: closeLogin,
onSubmit: geoStoreLoginSubmit,
onError: loginFail
Expand All @@ -61,9 +61,9 @@ const LoginNav = connect((state) => ({
bsStyle: "primary",
className: "square-button"
}), {
onShowLogin: setControlProperty.bind(null, "LoginForm", "enabled", true),
onShowAccountInfo: setControlProperty.bind(null, "AccountInfo", "enabled", true),
onShowChangePassword: setControlProperty.bind(null, "ResetPassword", "enabled", true),
onShowLogin: setControlProperty.bind(null, "LoginForm", "enabled", true, true),
onShowAccountInfo: setControlProperty.bind(null, "AccountInfo", "enabled", true, true),
onShowChangePassword: setControlProperty.bind(null, "ResetPassword", "enabled", true, true),
onLogout: logoutWithReload
})(require('../../components/security/UserMenu'));

Expand Down

0 comments on commit 046df65

Please sign in to comment.