Fix compose issues. Add host and end early
This commit is contained in:
parent
eee3e7e47b
commit
a5f2f19898
5 changed files with 259 additions and 223 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue