diff --git a/frontend/src/components/HallSelector.tsx b/frontend/src/components/HallSelector.tsx index 1731cc0..46ed8c9 100644 --- a/frontend/src/components/HallSelector.tsx +++ b/frontend/src/components/HallSelector.tsx @@ -1,4 +1,4 @@ -import { useMemo, useRef, useState } from 'react'; +import { useMemo, useRef, useState, useEffect } from 'react'; import { useDispatch, useSelector } from 'react-redux'; import { RootState } from '../store/store'; import { setSelectedHall } from '../store/hallsSlice'; @@ -18,6 +18,12 @@ const HallSelector = () => { return Array.from(hallSet).sort(); }, [contest.teams]); + useEffect(() => { + if (selectedHall && !halls.includes(selectedHall)) { + dispatch(setSelectedHall(null)); + } + }, [halls, selectedHall, dispatch]); + if (halls.length === 0) return null; const handleSelect = (hall: string | null) => { diff --git a/frontend/src/index.css b/frontend/src/index.css index 19fdd68..e5bfa75 100644 --- a/frontend/src/index.css +++ b/frontend/src/index.css @@ -29,6 +29,7 @@ body { nav>*, footer>* { + display: inline-block; margin-right: 1em; }