From 2c8368382b6eed438cdd86a9af01d3bcfc06c4ed Mon Sep 17 00:00:00 2001 From: iyanfdezz Date: Sat, 27 Apr 2024 11:44:33 +0200 Subject: [PATCH] Arreglado bug del ranking cuando no hay stats --- webapp/src/locales/en.json | 3 ++- webapp/src/locales/es.json | 3 ++- webapp/src/pages/Ranking/Ranking.js | 13 ++++++++++++- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/webapp/src/locales/en.json b/webapp/src/locales/en.json index 11b00d8c..eb9021da 100644 --- a/webapp/src/locales/en.json +++ b/webapp/src/locales/en.json @@ -155,7 +155,8 @@ "ratioCorrect": "Correct Ratio (%)", "avgTime": "Time per Question (s):", "reboot": "Reset to Default", - "errorText": "An error occurred while retrieving the ranking" + "errorText": "An error occurred while retrieving the ranking", + "noStats":"No stats found for this gamemode" }, "about": { "title": "WIQ_es1a Team", diff --git a/webapp/src/locales/es.json b/webapp/src/locales/es.json index 33e57b6b..042043f4 100644 --- a/webapp/src/locales/es.json +++ b/webapp/src/locales/es.json @@ -155,7 +155,8 @@ "ratioCorrect": "Ratio de aciertos (%)", "avgTime": "Tiempo por pregunta (s):", "reboot": "Restablecer por defecto", - "errorText": "Ha ocurrido un error al obtener el ranking" + "errorText": "Ha ocurrido un error al obtener el ranking", + "noStats":"No hay estadísticas para este modo de juego" }, "about": { "title": "Equipo WIQ_es1a", diff --git a/webapp/src/pages/Ranking/Ranking.js b/webapp/src/pages/Ranking/Ranking.js index 433a45ac..d8efc643 100644 --- a/webapp/src/pages/Ranking/Ranking.js +++ b/webapp/src/pages/Ranking/Ranking.js @@ -153,7 +153,9 @@ const Ranking = () => { > {t('pages.ranking.humancalculator')} - + {ranking && ranking.length>0 ? ( + <> +
@@ -169,6 +171,15 @@ const Ranking = () => { ))}
{t('pages.ranking.user')}
+ + ): + <> +
+ {t('pages.ranking.errorText')} +

{t('pages.ranking.noStats')}

+
+ } +