Skip to content

Commit

Permalink
♻️ set no default winner selection
Browse files Browse the repository at this point in the history
  • Loading branch information
ITegs committed Jun 6, 2023
1 parent 78d7c93 commit b1c4ba8
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/components/AddGameCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export default function AddGameCard(props: {
}) {
const [red, setRed] = useState<string[]>([]);
const [blue, setBlue] = useState<string[]>([]);
const [winner, setWinner] = useState<Team>(Team.RED);
const [winner, setWinner] = useState<Team>();

return (
<div className="AddGameCardContainer">
Expand Down Expand Up @@ -73,8 +73,10 @@ export default function AddGameCard(props: {
<p
className="AddGameCardButton AddButton"
onClick={() => {
addGame(red, blue, winner);
props.setShowAddGame(!props.showAddGame);
if (winner) {
addGame(red, blue, winner);
props.setShowAddGame(!props.showAddGame);
}
}}
>
Add
Expand Down

0 comments on commit b1c4ba8

Please sign in to comment.