Sort In Contention by ownership then name
In the bracket "In Contention" table, list players drafted by a manager first, then alphabetically by player name. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
parent
764d70af3a
commit
b8165cef3e
1 changed files with 8 additions and 1 deletions
|
|
@ -284,7 +284,14 @@ export function PlayoffBracket({
|
||||||
const activeParticipants = [...allBracketParticipantIds]
|
const activeParticipants = [...allBracketParticipantIds]
|
||||||
.filter((id) => !rankedParticipantIds.has(id))
|
.filter((id) => !rankedParticipantIds.has(id))
|
||||||
.map((id) => participantMap.get(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) =>
|
const isDraftedOrScoring = (participantId: string) =>
|
||||||
ownershipMap.has(participantId) || (pointsMap.get(participantId) ?? 0) > 0;
|
ownershipMap.has(participantId) || (pointsMap.get(participantId) ?? 0) > 0;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue