hide players with scores from add score dropdown
This commit is contained in:
parent
cefcdfef07
commit
b4ede07bcd
1 changed files with 8 additions and 7 deletions
|
|
@ -219,29 +219,30 @@
|
||||||
})
|
})
|
||||||
|
|
||||||
// Player options for dropdown - members first, then phantoms
|
// Player options for dropdown - members first, then phantoms
|
||||||
|
// Excludes players who already have scores for this event
|
||||||
const playerOptions = $derived.by(() => {
|
const playerOptions = $derived.by(() => {
|
||||||
const options: Array<{ value: string; label: string; suffix?: string; muted?: boolean }> = []
|
const options: Array<{ value: string; label: string; suffix?: string }> = []
|
||||||
|
|
||||||
// Add members
|
// Add members (skip those with scores)
|
||||||
for (const m of membersDuringEvent) {
|
for (const m of membersDuringEvent) {
|
||||||
if (m.user) {
|
if (m.user) {
|
||||||
const hasScore = playersWithScores.has(`member:${m.id}`)
|
const hasScore = playersWithScores.has(`member:${m.id}`)
|
||||||
|
if (hasScore) continue
|
||||||
options.push({
|
options.push({
|
||||||
value: `member:${m.id}`,
|
value: `member:${m.id}`,
|
||||||
label: m.user.username + (m.retired ? ' (Retired)' : ''),
|
label: m.user.username + (m.retired ? ' (Retired)' : '')
|
||||||
muted: hasScore
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add phantoms
|
// Add phantoms (skip those with scores)
|
||||||
for (const p of phantomPlayers) {
|
for (const p of phantomPlayers) {
|
||||||
const hasScore = playersWithScores.has(`phantom:${p.id}`)
|
const hasScore = playersWithScores.has(`phantom:${p.id}`)
|
||||||
|
if (hasScore) continue
|
||||||
options.push({
|
options.push({
|
||||||
value: `phantom:${p.id}`,
|
value: `phantom:${p.id}`,
|
||||||
label: p.name + (p.retired ? ' (Retired)' : ''),
|
label: p.name + (p.retired ? ' (Retired)' : ''),
|
||||||
suffix: 'Phantom',
|
suffix: 'Phantom'
|
||||||
muted: hasScore
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue