From 771ab5751601f768e33012ffe4b8a04aba834372 Mon Sep 17 00:00:00 2001 From: Angel Montenegro Date: Tue, 13 Aug 2024 11:11:59 -0600 Subject: [PATCH] If the email address is not verified, we should not consider its visibility for the domain visibility (#2325) --- .../modals/modal-email/modal-email.component.ts | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/app/cdk/side-bar/modals/modal-email/modal-email.component.ts b/src/app/cdk/side-bar/modals/modal-email/modal-email.component.ts index 9e0e26a84..54fe6ca6e 100644 --- a/src/app/cdk/side-bar/modals/modal-email/modal-email.component.ts +++ b/src/app/cdk/side-bar/modals/modal-email/modal-email.component.ts @@ -596,14 +596,13 @@ export class ModalEmailComponent implements OnInit, OnDestroy { visibilities: VisibilityStrings[] = [] ): void { if (visibilities.length === 0) { - Object.keys(this.emailsForm.controls).forEach((controlKey) => { - if (controlKey.startsWith('emailInput')) { - const control = this.emailsForm.get(controlKey) - if (control.value.email.split('@')[1] === domain) { - visibilities.push(control.value.visibility) - } + this.emails.forEach((email) => { + if(email.verified) { + if(email.value.split('@')[1] === domain) { + visibilities.push(email.visibility) + } } - }) + }); } const leastPermissiveVisibility =