From 3ed7186d78256cbf164f5e27a639d2f251d16692 Mon Sep 17 00:00:00 2001 From: regalijan Date: Thu, 19 Oct 2023 16:50:51 -0400 Subject: [PATCH] Don't allow duplicate usernames in new game ban modal --- components/NewGameBan.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/components/NewGameBan.tsx b/components/NewGameBan.tsx index 6ca125b..77b98b0 100644 --- a/components/NewGameBan.tsx +++ b/components/NewGameBan.tsx @@ -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); }