From 60b90137d4b975049b7a54a95b0d605ceceace75 Mon Sep 17 00:00:00 2001 From: Toni Barth Date: Fri, 20 Sep 2024 16:34:00 +0200 Subject: [PATCH] fix the Don't intercept selector not working anymore --- client/src/pages/game/slot-selector.tsx | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/client/src/pages/game/slot-selector.tsx b/client/src/pages/game/slot-selector.tsx index 394c4bc..3dbefaf 100644 --- a/client/src/pages/game/slot-selector.tsx +++ b/client/src/pages/game/slot-selector.tsx @@ -406,7 +406,24 @@ export default ({ game }: { game: Game }) => { type="radio" defaultValue="0" value={selectedSlot} - onChange={(e) => setSelectedSlot(e)} + onChange={(e) => { + setSelectedKeySlot(e) + setSelectedSlot(e) + + let p = game.players.find( + (p) => p.turn_player, + ) as Player + + EventManager.publish(Events.slotSelected, { + unavailable: true, + slot: null, + from_year: p.slots[0].to_year, + to_year: + p.slots[p.slots.length - 1] + .from_year, + slot_count: p.slots.length, + } satisfies SlotSelectedData) + }} >