Skip to content

Commit

Permalink
Arreglado bug del ranking cuando no hay stats
Browse files Browse the repository at this point in the history
  • Loading branch information
iyanfdezz committed Apr 27, 2024
1 parent 9203577 commit 2c83683
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
3 changes: 2 additions & 1 deletion webapp/src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
3 changes: 2 additions & 1 deletion webapp/src/locales/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
13 changes: 12 additions & 1 deletion webapp/src/pages/Ranking/Ranking.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,9 @@ const Ranking = () => {
>
{t('pages.ranking.humancalculator')}
</Button>
<Table>
{ranking && ranking.length>0 ? (
<>
<Table>
<Thead>
<Tr>
<Th>{t('pages.ranking.user')}</Th>
Expand All @@ -169,6 +171,15 @@ const Ranking = () => {
))}
</Tbody>
</Table>
</>
):
<>
<div>
<Heading as="h2">{t('pages.ranking.errorText')}</Heading>
<p>{t('pages.ranking.noStats')}</p>
</div>
</>}

</Flex>
<Footer/>
</>
Expand Down

0 comments on commit 2c83683

Please sign in to comment.