Front: Song Lobby: Fallback if no previous score

This commit is contained in:
Arthur Jamet
2023-05-04 13:02:08 +01:00
parent c3e8fb1c45
commit 3c3ed74995

View File

@@ -59,13 +59,13 @@ const SongLobbyView = (props: RouteProps<SongLobbyProps>) => {
<Text bold fontSize='lg'>
<Translate translationKey='bestScore'/>
</Text>
<Text>{scoresQuery.data!.sort()[0]?.score}</Text>
<Text>{scoresQuery.data!.sort()[0]?.score ?? 0}</Text>
</Box>
<Box style={{ flexDirection: 'column', alignItems: 'center' }}>
<Text bold fontSize='lg'>
<Translate translationKey='lastScore'/>
</Text>
<Text>{scoresQuery.data!.slice(-1)[0]!.score}</Text>
<Text>{scoresQuery.data!.slice(-1)[0]?.score ?? 0}</Text>
</Box>
</Box>
{/* <Text style={{ paddingBottom: 10 }}>{songQuery.data!.description}</Text> */}