Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add subdomain support to the email modal #2429

Merged
merged 3 commits into from
Dec 16, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
improve subdomain logic
  • Loading branch information
auumgn committed Dec 16, 2024
commit c2fe5ba16b5eb03dce21c36c17dd6dfe444ed8d1
14 changes: 11 additions & 3 deletions src/app/cdk/side-bar/modals/modal-email/modal-email.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,9 @@ export class ModalEmailComponent implements OnInit, OnDestroy {
if (domain) {
const remainingEmailsHaveDomain = this.emails.find((email) =>
email
? email.verified && email.value.split('@')[1].endsWith(domain)
? email.verified &&
(email.value.split('@')[1].endsWith('.' + domain) ||
email.value.split('@')[1] === domain)
: false
)
if (!remainingEmailsHaveDomain) {
Expand Down Expand Up @@ -581,7 +583,10 @@ export class ModalEmailComponent implements OnInit, OnDestroy {
if (controlKey.startsWith('emailInput')) {
const control = this.emailsForm.get(controlKey).value

if (control.email.split('@')[1].endsWith(domain)) {
if (
control.email.split('@')[1].endsWith('.' + domain) ||
control.email.split('@')[1] === domain
) {
visibilities.push(control.visibility)
}
}
Expand Down Expand Up @@ -614,7 +619,10 @@ export class ModalEmailComponent implements OnInit, OnDestroy {
Object.keys(this.emailsForm.controls).forEach((controlKey) => {
if (controlKey.startsWith('emailInput')) {
const control = this.emailsForm.get(controlKey)
if (control.value.email.split('@')[1].endsWith(domain)) {
if (
control.value.email.split('@')[1].endsWith('.' + domain) ||
control.value.email.split('@')[1] === domain
) {
if (this.isEmailVerified(control.value.email)) {
visibilities.push(control.value.visibility)
}
Expand Down
Loading