From 479bd1a2b307a1fc35b7ca5869166875612c62b1 Mon Sep 17 00:00:00 2001 From: Carlos Tadeu Panato Junior Date: Tue, 24 Jan 2017 12:51:43 +0100 Subject: Move instances of Client.resendVerification() in components to an action (#5169) --- webapp/actions/user_actions.jsx | 16 ++++++++++++++++ webapp/components/should_verify_email.jsx | 5 +++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/webapp/actions/user_actions.jsx b/webapp/actions/user_actions.jsx index 3f9715cd5..09148c3f2 100644 --- a/webapp/actions/user_actions.jsx +++ b/webapp/actions/user_actions.jsx @@ -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); + } + } + ); +} diff --git a/webapp/components/should_verify_email.jsx b/webapp/components/should_verify_email.jsx index 5ac67e383..61edf9422 100644 --- a/webapp/components/should_verify_email.jsx +++ b/webapp/components/should_verify_email.jsx @@ -2,11 +2,12 @@ // See License.txt for license information. import {FormattedMessage} from 'react-intl'; -import Client from 'client/web_client.jsx'; import React from 'react'; import {Link} from 'react-router/es6'; +import {resendVerification} from 'actions/user_actions.jsx'; + export default class ShouldVerifyEmail extends React.Component { constructor(props) { super(props); @@ -22,7 +23,7 @@ export default class ShouldVerifyEmail extends React.Component { this.setState({resendStatus: 'sending'}); - Client.resendVerification( + resendVerification( email, () => { this.setState({resendStatus: 'success'}); -- cgit v1.2.3-1-g7c22