mirror of
https://github.com/Pax1601/DCSOlympus.git
synced 2025-10-29 16:56:34 +00:00
fix: hotgroup button updated when unit dies
This commit is contained in:
@@ -7,10 +7,8 @@ import { Unit } from "../../unit/unit";
|
||||
|
||||
export function HotGroupBar(props: {}) {
|
||||
const [hotgroups, setHotgroups] = useState({} as { [key: number]: Unit[] });
|
||||
const [appState, setAppState] = useState(OlympusState.NOT_INITIALIZED);
|
||||
|
||||
useEffect(() => {
|
||||
AppStateChangedEvent.on((state, subState) => setAppState(state));
|
||||
HotgroupsChangedEvent.on((hotgroups) => setHotgroups({ ...hotgroups }));
|
||||
}, []);
|
||||
|
||||
@@ -38,7 +36,7 @@ export function HotGroupBar(props: {}) {
|
||||
<span
|
||||
className={`text-white`}
|
||||
>
|
||||
{units.length}
|
||||
{units.filter((unit) => unit.getAlive()).length}
|
||||
</span>
|
||||
</OlStateButton>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user