From 95d6ed6f118aa1430154aa5f63f647d6126791df Mon Sep 17 00:00:00 2001 From: Jeremy Kahn Date: Sat, 29 Oct 2022 12:54:40 -0500 Subject: [PATCH] fix: [closes #59] prevent users from using empty room names --- src/pages/Home/Home.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/pages/Home/Home.tsx b/src/pages/Home/Home.tsx index 358e537..bcabe47 100644 --- a/src/pages/Home/Home.tsx +++ b/src/pages/Home/Home.tsx @@ -47,6 +47,8 @@ export function Home({ userId }: HomeProps) { navigate(`/private/${roomName}`) } + const isRoomNameValid = roomName.length > 0 + return (
@@ -83,6 +85,7 @@ export function Home({ userId }: HomeProps) { sx={{ marginTop: 2, }} + disabled={!isRoomNameValid} > Join public room @@ -93,6 +96,7 @@ export function Home({ userId }: HomeProps) { marginTop: 2, marginLeft: 2, }} + disabled={!isRoomNameValid} > Join private room