toLowerCase cant read propety solved on edit event

This commit is contained in:
Eudes Inácio
2022-12-21 12:26:43 +01:00
9 changed files with 63 additions and 101 deletions
@@ -118,8 +118,8 @@ export class AttendeePage implements OnInit {
filterSearchList(itm: EventPerson): boolean {
const result = this.LtaskParticipants.concat(this.LtaskParticipantsCc).find((contact, index)=>{
if(contact.Name.toLowerCase() == itm.Name.toLowerCase() && contact.EmailAddress.toLowerCase() == itm.EmailAddress.toLowerCase()){
if(this.checkStringNull(contact.Name) == this.checkStringNull(itm.Name) && this.checkStringNull(contact.EmailAddress) == this.checkStringNull(itm.EmailAddress)){
index = index;
return contact;
}
@@ -133,7 +133,7 @@ export class AttendeePage implements OnInit {
const result2 = this.LtaskParticipantsCc.find((contact, index)=>{
if(contact.Name.toLowerCase() == itm.Name && contact.EmailAddress.toLowerCase() == itm.EmailAddress.toLowerCase()){
if(this.checkStringNull(contact.Name) == itm.Name && this.checkStringNull(contact.EmailAddress) == this.checkStringNull(itm.EmailAddress)){
index = index;
return contact;
}
@@ -199,7 +199,7 @@ export class AttendeePage implements OnInit {
{
this.eventPersons.forEach(attendee => {
const index: number = result.findIndex((cont) => {
return cont.EmailAddress.toLowerCase() == attendee.EmailAddress.toLowerCase()
return this.checkStringNull(cont.EmailAddress) == this.checkStringNull(attendee.EmailAddress)
});
result.splice(index, 1);
@@ -212,4 +212,12 @@ export class AttendeePage implements OnInit {
);
}
checkStringNull(value: string) {
if(value) {
return value.toLowerCase();
} else {
return value
}
}
}