mirror of
https://github.com/wassname/talk.git
synced 2026-07-11 12:19:34 +08:00
Email Attach Fixes
This commit is contained in:
@@ -45,6 +45,10 @@ class AddEmailAddressDialog extends React.Component {
|
||||
),
|
||||
};
|
||||
|
||||
componentDidMount() {
|
||||
this.props.startAttach();
|
||||
}
|
||||
|
||||
onChange = e => {
|
||||
const { name, value } = e.target;
|
||||
this.setState(
|
||||
@@ -99,7 +103,13 @@ class AddEmailAddressDialog extends React.Component {
|
||||
});
|
||||
};
|
||||
|
||||
confirmChanges = async () => {
|
||||
finish = () => {
|
||||
this.props.finishAttach();
|
||||
};
|
||||
|
||||
confirmChanges = async e => {
|
||||
e.preventDefault();
|
||||
|
||||
if (!this.validate()) {
|
||||
this.showErrors();
|
||||
return;
|
||||
@@ -113,6 +123,8 @@ class AddEmailAddressDialog extends React.Component {
|
||||
email: emailAddress,
|
||||
password: confirmPassword,
|
||||
});
|
||||
|
||||
// TODO: translate
|
||||
this.props.notify('success', 'Email Added!');
|
||||
this.goToNextStep();
|
||||
} catch (err) {
|
||||
@@ -143,13 +155,13 @@ class AddEmailAddressDialog extends React.Component {
|
||||
)}
|
||||
{step === 1 &&
|
||||
!settings.requireEmailConfirmation && (
|
||||
<EmailAddressAdded done={() => {}} />
|
||||
<EmailAddressAdded done={this.finish} />
|
||||
)}
|
||||
{step === 1 &&
|
||||
settings.requireEmailConfirmation && (
|
||||
<VerifyEmailAddress
|
||||
emailAddress={formData.emailAddress}
|
||||
done={() => {}}
|
||||
done={this.finish}
|
||||
/>
|
||||
)}
|
||||
</Dialog>
|
||||
@@ -161,6 +173,8 @@ AddEmailAddressDialog.propTypes = {
|
||||
attachLocalAuth: PropTypes.func.isRequired,
|
||||
notify: PropTypes.func.isRequired,
|
||||
root: PropTypes.object.isRequired,
|
||||
startAttach: PropTypes.func.isRequired,
|
||||
finishAttach: PropTypes.func.isRequired,
|
||||
};
|
||||
|
||||
export default AddEmailAddressDialog;
|
||||
|
||||
Reference in New Issue
Block a user