Skip to content

Commit

Permalink
[FIX] Freeze on login
Browse files Browse the repository at this point in the history
  • Loading branch information
djorkaeffalexandre committed Feb 11, 2020
1 parent 90ceda6 commit 55ab267
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions app/views/LanguageView/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import I18n from '../../i18n';
import Loading from '../../containers/Loading';
import { showErrorAlert } from '../../utils/info';
import log from '../../utils/log';
import { setUser as setUserAction, loginRequest as loginRequestAction } from '../../actions/login';
import { setUser as setUserAction, loginSuccess as loginSuccessAction } from '../../actions/login';
import StatusBar from '../../containers/StatusBar';
import { CustomIcon } from '../../lib/Icons';
import sharedStyles from '../Styles';
Expand Down Expand Up @@ -62,7 +62,7 @@ class LanguageView extends React.Component {
user: PropTypes.object,
setUser: PropTypes.func,
appStart: PropTypes.func,
loginRequest: PropTypes.func,
loginSuccess: PropTypes.func,
theme: PropTypes.string
}

Expand Down Expand Up @@ -105,7 +105,7 @@ class LanguageView extends React.Component {
this.setState({ saving: true });

const {
user, setUser, appStart, loginRequest
user, setUser, appStart, loginSuccess
} = this.props;

const params = {};
Expand All @@ -120,7 +120,7 @@ class LanguageView extends React.Component {
setUser({ language: params.language });

await appStart('loading');
await loginRequest({ resume: user.token }, true);
await loginSuccess({ ...user, ...params });
} catch (e) {
showErrorAlert(I18n.t('There_was_an_error_while_action', { action: I18n.t('saving_preferences') }));
log(e);
Expand Down Expand Up @@ -191,7 +191,7 @@ const mapStateToProps = state => ({

const mapDispatchToProps = dispatch => ({
setUser: params => dispatch(setUserAction(params)),
loginRequest: (...params) => dispatch(loginRequestAction(...params)),
loginSuccess: params => dispatch(loginSuccessAction(params)),
appStart: params => dispatch(appStartAction(params))
});

Expand Down

0 comments on commit 55ab267

Please sign in to comment.