Show bracket on tennis Grand Slam major event pages #113
1 changed files with 8 additions and 1 deletions
|
|
@ -284,7 +284,14 @@ export function PlayoffBracket({
|
|||
const activeParticipants = [...allBracketParticipantIds]
|
||||
.filter((id) => !rankedParticipantIds.has(id))
|
||||
.map((id) => participantMap.get(id))
|
||||
.filter((p): p is Participant => p !== undefined);
|
||||
.filter((p): p is Participant => p !== undefined)
|
||||
// Owned-by-a-manager players first, then alphabetical by name.
|
||||
.sort((a, b) => {
|
||||
const aOwned = ownershipMap.has(a.id);
|
||||
const bOwned = ownershipMap.has(b.id);
|
||||
if (aOwned !== bOwned) return aOwned ? -1 : 1;
|
||||
return a.name.localeCompare(b.name);
|
||||
});
|
||||
|
||||
const isDraftedOrScoring = (participantId: string) =>
|
||||
ownershipMap.has(participantId) || (pointsMap.get(participantId) ?? 0) > 0;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue