From 1545c9240b06b66fb44760b7dde8a828b13991ff Mon Sep 17 00:00:00 2001 From: Arthur Jamet Date: Tue, 23 May 2023 11:12:40 +0100 Subject: [PATCH] Front: Song Lobby: use null safety --- front/views/SongLobbyView.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/front/views/SongLobbyView.tsx b/front/views/SongLobbyView.tsx index 0254eec..7f453e7 100644 --- a/front/views/SongLobbyView.tsx +++ b/front/views/SongLobbyView.tsx @@ -39,7 +39,7 @@ const SongLobbyView = (props: RouteProps) => { {songQuery.data!.name} `${level} - ${ chaptersQuery.data!.reduce((a, b) => a + b.difficulty, 0) / chaptersQuery.data!.length }`} + format={(level) => `${level}: ${ chaptersQuery.data!.reduce((a, b) => a + b.difficulty, 0) / chaptersQuery.data!.length }`} /> ) => { - {scoresQuery.data!.best ?? 0} + {scoresQuery.data?.best ?? 0} - {scoresQuery.data!.history[0]?.score ?? 0} + {scoresQuery.data?.history.at(0)?.score ?? 0} {/* {songQuery.data!.description} */}