Skip to content

Commit

Permalink
Fix LoS speaker order (#3708)
Browse files Browse the repository at this point in the history
  • Loading branch information
bastianjoel authored May 29, 2024
1 parent 1d1bd70 commit 3636b5d
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -541,11 +541,11 @@ export class ListOfSpeakersContentComponent extends BaseMeetingComponent impleme
);
}

private findOperatorSpeaker(pointOfOrder?: boolean): ViewSpeaker | undefined {
return this.waitingSpeakers
.sort((a, b) => b.id - a.id)
.find(
speaker => speaker.user_id === this.operator.operatorId && !!speaker.point_of_order === !!pointOfOrder
);
private findOperatorSpeaker(pointOfOrder?: boolean): ViewSpeaker | null {
const opSpeakers = this.waitingSpeakers.filter(
speaker => speaker.user_id === this.operator.operatorId && !!speaker.point_of_order === !!pointOfOrder
);

return opSpeakers.reduce((acc, curr) => (curr?.weight > acc?.weight ? curr : opSpeakers[0]), null);
}
}

0 comments on commit 3636b5d

Please sign in to comment.