Skip to content

Commit

Permalink
filter out duplicate speakers
Browse files Browse the repository at this point in the history
  • Loading branch information
H-Shay committed Jan 30, 2024
1 parent 3deb801 commit 666616a
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion src/Conference.ts
Original file line number Diff line number Diff line change
Expand Up @@ -729,7 +729,21 @@ export class Conference {
public async getInviteTargetsForAuditorium(auditorium: Auditorium, backstage = false): Promise<IPerson[]> {
const people = await this.getPeopleForAuditorium(auditorium);
const roles = [Role.Coordinator, Role.Host, Role.Speaker];
return people.filter(p => roles.includes(p.role));
let includesPerson = (person, array) => {
for (const element of array) {
if (element.name === person.name) {
return true
}
}
return false
};
let uniquePeople: IPerson[] = []
for (const person of people) {
if (!includesPerson(person, uniquePeople)) {
uniquePeople.push(person)
}
}
return uniquePeople.filter(p => roles.includes(p.role));
}

public async getInviteTargetsForTalk(talk: Talk): Promise<IPerson[]> {
Expand Down

0 comments on commit 666616a

Please sign in to comment.