Skip to content

Commit

Permalink
en teoria ya furrula el historial en local solo que se agrega doble
Browse files Browse the repository at this point in the history
  • Loading branch information
bidof committed May 1, 2024
1 parent 9baa649 commit de46dfe
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 28 deletions.
50 changes: 25 additions & 25 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"devDependencies": {
"@babel/plugin-proposal-private-property-in-object": "^7.21.11",
"jest": "^29.7.0",
"react-router-dom": "^6.22.3",
"react-router-dom": "^6.23.0",
"resize-observer-polyfill": "^1.5.1"
}
}
10 changes: 8 additions & 2 deletions webapp/src/components/history/History.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,14 @@ export function History({darkMode}){
console.log(partidas);

if(partidas.error || partidas.length === 0 ){
console.log('neverPlayer a true en useEffect en partidas');
setNeverPlayer(true);
setIsLoadingGames(false);
}
else{
act(() => {
console.log('neverPlayer a false en useEffect en partidas');
console.log('setAllGames ', Object.values(partidas));
let gamesArray = Object.values(partidas);
setAllGames(gamesArray);
setIsLoadingGames(false);
Expand All @@ -53,14 +56,17 @@ export function History({darkMode}){
fetch(statisticsEndpoint)
.then(response => response.json())
.then(estadisticas => {
//console.log("Estadísticas: ");
//console.log(estadisticas);
console.log("Estadísticas: ");
console.log(estadisticas);
if(estadisticas.error || estadisticas.length === 0 ){
console.log('neverPlayer a true en useEffect en estadisticas');
setNeverPlayer(true);
setIsLoadingStats(false);
}
else{
act(() => {
//console.log('neverPlayer a false en useEffect en estadisticas');
//console.log('setAllGames ', Object.values(estadisticas));
setStatistics(estadisticas);
setIsLoadingStats(false);
});
Expand Down

0 comments on commit de46dfe

Please sign in to comment.