diff --git a/src/app/pages/agenda/agenda.page.ts b/src/app/pages/agenda/agenda.page.ts index aca6a0a9b..125594776 100644 --- a/src/app/pages/agenda/agenda.page.ts +++ b/src/app/pages/agenda/agenda.page.ts @@ -10,7 +10,7 @@ import { AlertService } from 'src/app/services/alert.service'; import { momentG } from 'src/plugin/momentG'; import { DomSanitizer } from "@angular/platform-browser"; import { EventPerson } from 'src/app/models/eventperson.model'; - +import { removeDuplicate } from 'src/plugin/removeDuplicate.js' // showTimeline import { setHours, setMinutes } from 'date-fns'; @@ -1045,12 +1045,12 @@ export class AgendaPage implements OnInit { } async setIntervenient(data) { - this.taskParticipants = data; + this.taskParticipants = removeDuplicate(data) } async setIntervenientCC(data) { - this.taskParticipantsCc = data; + this.taskParticipantsCc = removeDuplicate(data) } // Emitters @@ -1063,4 +1063,5 @@ export class AgendaPage implements OnInit { this.postEvent = false; } -} \ No newline at end of file +} + diff --git a/src/app/shared/agenda/edit-event/edit-event.component.ts b/src/app/shared/agenda/edit-event/edit-event.component.ts index a1cf608b2..457558bfa 100644 --- a/src/app/shared/agenda/edit-event/edit-event.component.ts +++ b/src/app/shared/agenda/edit-event/edit-event.component.ts @@ -5,7 +5,7 @@ import { EventPerson } from 'src/app/models/eventperson.model'; import { EventsService } from 'src/app/services/events.service'; import { Event } from 'src/app/models/event.model'; import { AlertController } from '@ionic/angular'; - +import { removeDuplicate } from 'src/plugin/removeDuplicate.js' @Component({ selector: 'app-edit-event', templateUrl: './edit-event.component.html', @@ -41,7 +41,7 @@ export class EditEventComponent implements OnInit { private eventsService: EventsService, public alertController: AlertController, ) { - + } ngOnInit() { @@ -52,13 +52,16 @@ export class EditEventComponent implements OnInit { // attendees list if(this.postEvent.Attendees != null) { this.postEvent.Attendees.forEach(e =>{ - if(e.IsRequired){ + if(e.IsRequired) { this.taskParticipants.push(e); } else { this.taskParticipantsCc.push(e); } }) } + + this.taskParticipants = removeDuplicate(this.taskParticipants); + this.taskParticipantsCc = removeDuplicate(this.taskParticipantsCc); this.isEventEdited = false; @@ -79,7 +82,7 @@ export class EditEventComponent implements OnInit { async save(){ - this.postEvent.Attendees = this.taskParticipants.concat(this.taskParticipantsCc) + this.postEvent.Attendees = this.taskParticipants.concat(this.taskParticipantsCc); await this.eventsService.editEvent(this.postEvent, 2, 3).subscribe(async () => { const alert = await this.alertController.create({ diff --git a/src/app/shared/header/header.page.html b/src/app/shared/header/header.page.html index bc2c14d43..9c44dcb51 100644 --- a/src/app/shared/header/header.page.html +++ b/src/app/shared/header/header.page.html @@ -87,7 +87,6 @@ - diff --git a/src/app/shared/header/header.page.ts b/src/app/shared/header/header.page.ts index 9ddb3bc94..ec9bfcfeb 100644 --- a/src/app/shared/header/header.page.ts +++ b/src/app/shared/header/header.page.ts @@ -41,8 +41,6 @@ export class HeaderPage implements OnInit { async openSearch() { - alert('alert'); - const modal = await this.modalController.create({ component: SearchPage, cssClass: 'group-messages modal-desktop search-modal search-modal-to-desktop', diff --git a/src/plugin/removeDuplicate.js b/src/plugin/removeDuplicate.js new file mode 100644 index 000000000..2ac749b21 --- /dev/null +++ b/src/plugin/removeDuplicate.js @@ -0,0 +1,11 @@ + +function removeDuplicate(data){ + + + return [...new Set(data.map(JSON.stringify))].map(JSON.parse) + +} + +module.exports = { + removeDuplicate: removeDuplicate +}; \ No newline at end of file