Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Don't allow duplicate usernames in new game ban modal
  • Loading branch information
regalijan committed Oct 19, 2023
1 parent 8cc3f58 commit 3ed7186
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions components/NewGameBan.tsx
Expand Up @@ -48,6 +48,9 @@ export default function(props: { isOpen: boolean; onClose: () => void }) {
function addUser(user: string) {
const newUsers = [...users];

if (newUsers.includes(user))
return;

newUsers.push(user);
setUsers(newUsers);
}
Expand Down

0 comments on commit 3ed7186

Please sign in to comment.