fix: only count human members when determining scout button availability
This commit is contained in:
parent
f1c74b7497
commit
59f3bedd9a
1 changed files with 5 additions and 9 deletions
|
|
@ -75,20 +75,16 @@
|
||||||
enabled: filter === 'pending' && crewStore.isOfficer
|
enabled: filter === 'pending' && crewStore.isOfficer
|
||||||
}))
|
}))
|
||||||
|
|
||||||
// Calculate total active roster size (members + phantoms)
|
// Calculate active member count (real members only, not phantoms)
|
||||||
const activeRosterSize = $derived.by(() => {
|
// Used to determine if scouting is disabled - phantoms can be replaced by real members
|
||||||
|
const activeMemberCount = $derived.by(() => {
|
||||||
// Use active filter data if viewing active, otherwise use dedicated query
|
// Use active filter data if viewing active, otherwise use dedicated query
|
||||||
const activeMembers =
|
const activeMembers =
|
||||||
filter === 'active' ? (membersQuery.data?.members ?? []) : (activeQuery.data?.members ?? [])
|
filter === 'active' ? (membersQuery.data?.members ?? []) : (activeQuery.data?.members ?? [])
|
||||||
const activePhantoms =
|
return activeMembers.filter((m) => !m.retired).length
|
||||||
filter === 'active' ? (membersQuery.data?.phantoms ?? []) : (activeQuery.data?.phantoms ?? [])
|
|
||||||
|
|
||||||
const activeMemberCount = activeMembers.filter((m) => !m.retired).length
|
|
||||||
const activePhantomCount = activePhantoms.filter((p) => !p.retired).length
|
|
||||||
return activeMemberCount + activePhantomCount
|
|
||||||
})
|
})
|
||||||
|
|
||||||
const isRosterFull = $derived(activeRosterSize >= 30)
|
const isRosterFull = $derived(activeMemberCount >= 30)
|
||||||
|
|
||||||
// Mutations
|
// Mutations
|
||||||
const removeMemberMutation = useRemoveMember()
|
const removeMemberMutation = useRemoveMember()
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue