Skip to content

Commit

Permalink
Fix minor frontend issues
Browse files Browse the repository at this point in the history
  • Loading branch information
nsychev committed Nov 13, 2024
1 parent d8757ee commit 0dbb5cd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
8 changes: 7 additions & 1 deletion frontend/src/components/HallSelector.tsx
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -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) => {
Expand Down
1 change: 1 addition & 0 deletions frontend/src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ body {

nav>*,
footer>* {
display: inline-block;
margin-right: 1em;
}

Expand Down

0 comments on commit 0dbb5cd

Please sign in to comment.