1
0

Fixed a bug in the Game.jsx

This commit is contained in:
Mathias Wagner 2023-11-20 21:19:06 +01:00
parent f4e65aef55
commit 03842b5e40
Signed by: Mathias
GPG Key ID: B8DC354B0A1F5B44

View File

@ -9,7 +9,7 @@ import HintSound from "@/common/sounds/hint.mp3";
import {MusicContext} from "@/common/contexts/MusicContext.jsx";
export const Game = () => {
const {groups} = useContext(GroupContext);
const {groups, allGroups} = useContext(GroupContext);
const [currentState, setCurrentState] = useState("hint");
@ -24,7 +24,8 @@ export const Game = () => {
return () => clearTimeout(timeout);
}, []);
if (groups.length === 0) return <Navigate to="/"/>;
if (groups.length === 0 && allGroups.length === 0)
return <Navigate to="/"/>;
return (
<div className="game-page">