From 0124467b6aae56508ce3dbd84a35e549c6b6fc84 Mon Sep 17 00:00:00 2001 From: Mathias Wagner Date: Mon, 20 Nov 2023 21:17:02 +0100 Subject: [PATCH] Added GroupContext.jsx#resetGame --- client/src/common/contexts/GroupContext.jsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/client/src/common/contexts/GroupContext.jsx b/client/src/common/contexts/GroupContext.jsx index 552a8a4..03d0454 100644 --- a/client/src/common/contexts/GroupContext.jsx +++ b/client/src/common/contexts/GroupContext.jsx @@ -47,6 +47,12 @@ export const GroupProvider = ({children}) => { setRound([]); } + const resetGame = () => { + setAllGroups([]); + setGroups([]); + setRound([]); + } + useEffect(() => { socket.on("JOINED", handleJoin); socket.on("LEFT", handleLeave); @@ -58,7 +64,7 @@ export const GroupProvider = ({children}) => { }, []); return ( - + {children} )