mirror of
https://github.com/elyby/accounts-frontend.git
synced 2025-01-16 08:33:15 +05:30
small refactoring
This commit is contained in:
parent
0816e7a848
commit
232cf0465c
@ -8,7 +8,7 @@ import { LangMenu } from 'components/langMenu';
|
|||||||
import styles from './footerMenu.scss';
|
import styles from './footerMenu.scss';
|
||||||
import messages from './footerMenu.intl.json';
|
import messages from './footerMenu.intl.json';
|
||||||
|
|
||||||
export default class FooterMenu extends Component {
|
class FooterMenu extends Component {
|
||||||
static displayName = 'FooterMenu';
|
static displayName = 'FooterMenu';
|
||||||
|
|
||||||
static propTypes = {
|
static propTypes = {
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
import React, { Component, PropTypes } from 'react';
|
import React, { Component, PropTypes } from 'react';
|
||||||
|
|
||||||
import { FormattedMessage as Message } from 'react-intl';
|
import { FormattedMessage as Message } from 'react-intl';
|
||||||
import { Link } from 'react-router';
|
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import Helmet from 'react-helmet';
|
import Helmet from 'react-helmet';
|
||||||
import { Motion, spring } from 'react-motion';
|
import { Motion, spring } from 'react-motion';
|
||||||
|
@ -69,8 +69,11 @@ export default connect(null, {
|
|||||||
return Promise.resolve({requirePassword});
|
return Promise.resolve({requirePassword});
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.then((resp) => new Promise((resolve) => {
|
.then((resp) => !resp.requirePassword || requestPassword(form))
|
||||||
if (resp.requirePassword) {
|
.finally(() => form.endLoading());
|
||||||
|
|
||||||
|
function requestPassword(form) {
|
||||||
|
return new Promise((resolve) => {
|
||||||
dispatch(createPopup(PasswordRequestForm, (props) => ({
|
dispatch(createPopup(PasswordRequestForm, (props) => ({
|
||||||
form,
|
form,
|
||||||
onSubmit: () => {
|
onSubmit: () => {
|
||||||
@ -88,10 +91,7 @@ export default connect(null, {
|
|||||||
.finally(() => form.endLoading());
|
.finally(() => form.endLoading());
|
||||||
}
|
}
|
||||||
})));
|
})));
|
||||||
} else {
|
});
|
||||||
resolve();
|
|
||||||
}
|
}
|
||||||
}))
|
|
||||||
.finally(() => form.endLoading());
|
|
||||||
}
|
}
|
||||||
})(ProfilePage);
|
})(ProfilePage);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user