Fix compose issues. Add host and end early

This commit is contained in:
Joey Yakimowich-Payne 2026-01-15 20:51:20 -07:00
commit a5f2f19898
No known key found for this signature in database
GPG key ID: 6BFE655FA5ABD1E1
5 changed files with 259 additions and 223 deletions

View file

@ -854,6 +854,7 @@ export const useGame = () => {
if (p.id !== playerId) return p;
return { ...p, score: newScore, previousScore: p.score, streak: newStreak, lastAnswerCorrect: isCorrect, selectedShape, pointsBreakdown: breakdown };
});
playersRef.current = updatedPlayers;
setPlayers(updatedPlayers);
conn.send({ type: 'RESULT', payload: { isCorrect, scoreAdded: breakdown.total, newScore, breakdown } });
@ -1379,6 +1380,7 @@ export const useGame = () => {
if (p.id !== 'host') return p;
return { ...p, score: newScore, previousScore: p.score, streak: newStreak, lastAnswerCorrect: isCorrect, selectedShape: option.shape, pointsBreakdown: breakdown };
});
playersRef.current = updatedPlayers;
setPlayers(updatedPlayers);
const allAnswered = updatedPlayers.every(p => p.lastAnswerCorrect !== null);