1
0

Fixed a bug in the Create.jsx page

This commit is contained in:
Mathias Wagner 2023-11-20 21:17:23 +01:00
parent 0124467b6a
commit 301a658287
Signed by: Mathias
GPG Key ID: B8DC354B0A1F5B44

View File

@ -19,7 +19,7 @@ export const Create = () => {
const navigate = useNavigate();
const {musicEnabled} = useContext(MusicContext);
const {groups} = useContext(GroupContext);
const {groups, resetGame} = useContext(GroupContext);
const getRoomCode = () => {
socket.emit("CREATE_ROOM", undefined, (data) => {
@ -30,6 +30,8 @@ export const Create = () => {
useEffect(() => {
const timeout = setTimeout(() => getRoomCode(), 1000);
resetGame();
return () => clearTimeout(timeout);
}, []);