diff --git a/email_app/app/components/create_account.js b/email_app/app/components/create_account.js index 0ae6e05..e17ac9f 100644 --- a/email_app/app/components/create_account.js +++ b/email_app/app/components/create_account.js @@ -32,7 +32,7 @@ export default class CreateAccount extends Component { return createAccount(emailId) .then(this.storeCreatedAccount) .catch((err) => { - if (err.name === 'ERR_DATA_EXISTS') { + if (err.code === -104) { return createAccountError(new Error(MESSAGES.EMAIL_ALREADY_TAKEN)); } return createAccountError(err); diff --git a/email_app/app/safenet_comm.js b/email_app/app/safenet_comm.js index ee9d456..4b9ac50 100644 --- a/email_app/app/safenet_comm.js +++ b/email_app/app/safenet_comm.js @@ -195,7 +195,7 @@ export const setupAccount = (app, emailId) => { .then((pub_names_md) => pub_names_md.encryptKey(serviceInfo.publicId).then((key) => pub_names_md.get(key)) .then((services) => addEmailService(app, serviceInfo, inbox_serialised) , (err) => { - if (err.name === 'ERR_NO_SUCH_ENTRY') { + if (err.code === -106) { return createPublicIdAndEmailService(app, pub_names_md, serviceInfo, inbox_serialised); }