From 040bc5e1576f369f07ec29ad9c1c0497202d28ff Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Mon, 7 Oct 2019 17:43:51 +0200 Subject: [PATCH] show dialog when server says e-mail hasn't been verified yet as it's confusing to have nothing happen at all when clicking continue straight away. --- .../views/settings/account/EmailAddresses.js | 10 ++++++++-- src/i18n/strings/en_EN.json | 2 ++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/components/views/settings/account/EmailAddresses.js b/src/components/views/settings/account/EmailAddresses.js index 30fc805f6d..e50039d0b6 100644 --- a/src/components/views/settings/account/EmailAddresses.js +++ b/src/components/views/settings/account/EmailAddresses.js @@ -193,8 +193,14 @@ export default class EmailAddresses extends React.Component { this.props.onEmailsChange(emails); }).catch((err) => { this.setState({continueDisabled: false}); - if (err.errcode !== 'M_THREEPID_AUTH_FAILED') { - const ErrorDialog = sdk.getComponent("dialogs.ErrorDialog"); + const ErrorDialog = sdk.getComponent("dialogs.ErrorDialog"); + if (err.errcode === 'M_THREEPID_AUTH_FAILED') { + Modal.createTrackedDialog("Email hasn't been verified yet", "", ErrorDialog, { + title: _t("Your email address hasn't been verified yet"), + description: _t("Click the link in the email you received to verify, " + + "and then click continue again."), + }); + } else { console.error("Unable to verify email address: " + err); Modal.createTrackedDialog('Unable to verify email address', '', ErrorDialog, { title: _t("Unable to verify email address."), diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index fc094f48f6..74502444b8 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -759,6 +759,8 @@ "Invalid Email Address": "Invalid Email Address", "This doesn't appear to be a valid email address": "This doesn't appear to be a valid email address", "Unable to add email address": "Unable to add email address", + "Your e-mail address hasn't been verified yet": "Your e-mail address hasn't been verified yet", + "Click the link in the e-mail you received to verify, and then click continue again.": "Click the link in the e-mail you received to verify, and then click continue again.", "Add": "Add", "We've sent you an email to verify your address. Please follow the instructions there and then click the button below.": "We've sent you an email to verify your address. Please follow the instructions there and then click the button below.", "Email Address": "Email Address",