Move instances of Client.resendVerification() in components to an action (#5169)
Этот коммит содержится в:
коммит произвёл
George Goldberg
родитель
b87cd4e276
Коммит
479bd1a2b3
@@ -600,3 +600,19 @@ export function resetPassword(code, password, success, error) {
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function resendVerification(email, success, error) {
|
||||||
|
Client.resendVerification(
|
||||||
|
email,
|
||||||
|
() => {
|
||||||
|
if (success) {
|
||||||
|
success();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
(err) => {
|
||||||
|
if (error) {
|
||||||
|
error(err);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|||||||
@@ -2,11 +2,12 @@
|
|||||||
// See License.txt for license information.
|
// See License.txt for license information.
|
||||||
|
|
||||||
import {FormattedMessage} from 'react-intl';
|
import {FormattedMessage} from 'react-intl';
|
||||||
import Client from 'client/web_client.jsx';
|
|
||||||
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import {Link} from 'react-router/es6';
|
import {Link} from 'react-router/es6';
|
||||||
|
|
||||||
|
import {resendVerification} from 'actions/user_actions.jsx';
|
||||||
|
|
||||||
export default class ShouldVerifyEmail extends React.Component {
|
export default class ShouldVerifyEmail extends React.Component {
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props);
|
super(props);
|
||||||
@@ -22,7 +23,7 @@ export default class ShouldVerifyEmail extends React.Component {
|
|||||||
|
|
||||||
this.setState({resendStatus: 'sending'});
|
this.setState({resendStatus: 'sending'});
|
||||||
|
|
||||||
Client.resendVerification(
|
resendVerification(
|
||||||
email,
|
email,
|
||||||
() => {
|
() => {
|
||||||
this.setState({resendStatus: 'success'});
|
this.setState({resendStatus: 'success'});
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user