Fixed a bug in the Create.jsx page
This commit is contained in:
parent
0124467b6a
commit
301a658287
@ -19,7 +19,7 @@ export const Create = () => {
|
|||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
|
|
||||||
const {musicEnabled} = useContext(MusicContext);
|
const {musicEnabled} = useContext(MusicContext);
|
||||||
const {groups} = useContext(GroupContext);
|
const {groups, resetGame} = useContext(GroupContext);
|
||||||
|
|
||||||
const getRoomCode = () => {
|
const getRoomCode = () => {
|
||||||
socket.emit("CREATE_ROOM", undefined, (data) => {
|
socket.emit("CREATE_ROOM", undefined, (data) => {
|
||||||
@ -30,6 +30,8 @@ export const Create = () => {
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const timeout = setTimeout(() => getRoomCode(), 1000);
|
const timeout = setTimeout(() => getRoomCode(), 1000);
|
||||||
|
|
||||||
|
resetGame();
|
||||||
|
|
||||||
return () => clearTimeout(timeout);
|
return () => clearTimeout(timeout);
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user