diff --git a/src/app/shared/components/confirm-email/confirm-email.component.ts b/src/app/shared/components/confirm-email/confirm-email.component.ts index 54a102a92..fba3a8740 100644 --- a/src/app/shared/components/confirm-email/confirm-email.component.ts +++ b/src/app/shared/components/confirm-email/confirm-email.component.ts @@ -41,10 +41,19 @@ export class ConfirmEmailComponent { this.actions .deleteEmail(this.email.id) .pipe(takeUntilDestroyed(this.destroyRef)) - .subscribe(() => { - let showSuccessText = isMerge ? 'home.confirmEmail.merge.emailNotAdded' : 'home.confirmEmail.add.emailNotAdded'; - this.toastService.showSuccess(showSuccessText, { name: this.email.emailAddress }); - this.dialogRef.close(); + .subscribe({ + next: () => { + let showSuccessText = isMerge + ? 'home.confirmEmail.merge.emailNotAdded' + : 'home.confirmEmail.add.emailNotAdded'; + this.toastService.showSuccess(showSuccessText, { name: this.email.emailAddress }); + this.dialogRef.close(); + }, + error: () => { + let showErrorText = isMerge ? 'home.confirmEmail.merge.denyError' : 'home.confirmEmail.add.denyError'; + this.toastService.showError(showErrorText, { name: this.email.emailAddress }); + this.dialogRef.close(); + }, }); } @@ -61,7 +70,11 @@ export class ConfirmEmailComponent { this.toastService.showSuccess(showSuccessText, { name: this.email.emailAddress }); this.dialogRef.close(); }, - error: () => this.dialogRef.close(), + error: () => { + let showErrorText = isMerge ? 'home.confirmEmail.merge.verifyError' : 'home.confirmEmail.add.verifyError'; + this.toastService.showError(showErrorText, { name: this.email.emailAddress }); + this.dialogRef.close(); + }, }); } } diff --git a/src/assets/i18n/en.json b/src/assets/i18n/en.json index 70caa9767..2fc11f494 100644 --- a/src/assets/i18n/en.json +++ b/src/assets/i18n/en.json @@ -390,20 +390,24 @@ }, "confirmEmail": { "merge": { - "title": "Merge account", + "title": "Merge account?", "description": "Would you like to merge ", "description2": "into your account? This action is irreversible.", "goToEmails": "Merge account", "emailNotAdded": "{{name}} has not been merged into your account.", - "emailVerified": "{{name}} has been merged into your account." + "emailVerified": "{{name}} has been merged into your account.", + "verifyError": "There was a problem merging {{name}} into your account.", + "denyError": "There was a problem canceling the request to merge {{name}} into your account." }, "add": { - "title": "Add alternative email", + "title": "Add alternative email?", "description": "Do you want to add ", "description2": "to your profile ?", "goToEmails": "Add email", "emailNotAdded": "{{name}} has not been added to your account.", - "emailVerified": "{{name}} has been added to your account." + "emailVerified": "{{name}} has been added to your account.", + "verifyError": "There was a problem adding {{name} to your account.", + "denyError": "There was a problem canceling the request to add {{name}} to your account." } } },