1
0

Added GroupContext.jsx#resetGame

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

View File

@ -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 (
<GroupContext.Provider value={{groups, round, handleRound, getGroupById, updateCapital, endRound, allGroups}}>
<GroupContext.Provider value={{groups, round, handleRound, getGroupById, updateCapital, endRound, allGroups, resetGame}}>
{children}
</GroupContext.Provider>
)