mirror of
https://github.com/kingomarnajjar/flex-template-web.git
synced 2026-07-30 18:16:48 +10:00
Rename loginOrLogoutInProgress to authenticationInProgress
This commit is contained in:
parent
a99b33e5e8
commit
814184aa0a
3 changed files with 7 additions and 7 deletions
|
|
@ -5,7 +5,7 @@ import { Redirect } from 'react-router-dom';
|
|||
import { FormattedMessage, injectIntl, intlShape } from 'react-intl';
|
||||
import { PageLayout, NamedRedirect } from '../../components';
|
||||
import { LoginForm, SignUpForm } from '../../containers';
|
||||
import { login, loginOrLogoutInProgress } from '../../ducks/Auth.duck';
|
||||
import { login, authenticationInProgress } from '../../ducks/Auth.duck';
|
||||
|
||||
import css from './AuthenticationPage.css';
|
||||
|
||||
|
|
@ -91,7 +91,7 @@ const mapStateToProps = state => {
|
|||
return {
|
||||
isAuthenticated,
|
||||
loginError,
|
||||
authInProgress: loginOrLogoutInProgress(state),
|
||||
authInProgress: authenticationInProgress(state),
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ import React, { PropTypes } from 'react';
|
|||
import { compose } from 'redux';
|
||||
import { connect } from 'react-redux';
|
||||
import { withRouter } from 'react-router-dom';
|
||||
import { logout, loginOrLogoutInProgress } from '../../ducks/Auth.duck';
|
||||
import { logout, authenticationInProgress } from '../../ducks/Auth.duck';
|
||||
import { NamedLink, Button } from '../../components';
|
||||
import { withFlattenedRoutes } from '../../util/contextHelpers';
|
||||
import { pathByRouteName } from '../../util/routes';
|
||||
|
|
@ -66,7 +66,7 @@ const mapStateToProps = state => {
|
|||
const { isAuthenticated } = state.Auth;
|
||||
return {
|
||||
isAuthenticated,
|
||||
authInProgress: loginOrLogoutInProgress(state),
|
||||
authInProgress: authenticationInProgress(state),
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ export default function reducer(state = initialState, action = {}) {
|
|||
|
||||
// ================ Selectors ================ //
|
||||
|
||||
export const loginOrLogoutInProgress = state => {
|
||||
export const authenticationInProgress = state => {
|
||||
const { loginInProgress, logoutInProgress } = state.Auth;
|
||||
return loginInProgress || logoutInProgress;
|
||||
};
|
||||
|
|
@ -91,7 +91,7 @@ export const authInfo = () =>
|
|||
|
||||
export const login = (username, password) =>
|
||||
(dispatch, getState, sdk) => {
|
||||
if (loginOrLogoutInProgress(getState())) {
|
||||
if (authenticationInProgress(getState())) {
|
||||
return Promise.reject(new Error('Login or logout already in progress'));
|
||||
}
|
||||
dispatch(loginRequest());
|
||||
|
|
@ -107,7 +107,7 @@ export const login = (username, password) =>
|
|||
|
||||
export const logout = () =>
|
||||
(dispatch, getState, sdk) => {
|
||||
if (loginOrLogoutInProgress(getState())) {
|
||||
if (authenticationInProgress(getState())) {
|
||||
return Promise.reject(new Error('Login or logout already in progress'));
|
||||
}
|
||||
dispatch(logoutRequest());
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue