Skip to content

Commit

Permalink
se guarda bien el t
Browse files Browse the repository at this point in the history
  • Loading branch information
bidof committed May 1, 2024
1 parent 9c7513b commit 3d98ead
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions webapp/src/components/game/Game.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,16 +81,16 @@ function Game({darkMode,gameMode=new BasicGame()}) {
}


}, [correctAnswers, incorrectAnswers,totalTime, isFinished]);//<-cambiar el array de depencias error despliegue
}, [correctAnswers, incorrectAnswers]);//<-cambiar el array de depencias error despliegue
//para aseguarte que el historial se envie una vez lo separas
useEffect(() => {
if (isFinished) {
if (isFinished && totalTime > 0) {
console.log("tiempo total tardado en acabar ", totalTime);
gameModeRef.current.setTiempoTotal(totalTime);
gameModeRef.current.finishGame();
gameModeRef.current.sendHistory({correctas: correctAnswers, incorrectas: incorrectAnswers, tiempoTotal: totalTime});
}
}, [isFinished]);
}, [isFinished,totalTime]);
const handleTimeout = () => {
handleAnswerSelect(false);
};
Expand Down

0 comments on commit 3d98ead

Please sign in to comment.