From 073c00a35e9fb49c1abe7c8924ab2c67979a54ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Le=20Bihan?= Date: Thu, 14 Sep 2023 17:28:01 +0200 Subject: [PATCH] Fixed a bug when current streak is 0 and Linter fix --- front/views/PlayView.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/front/views/PlayView.tsx b/front/views/PlayView.tsx index 530f7fc..fb7df8a 100644 --- a/front/views/PlayView.tsx +++ b/front/views/PlayView.tsx @@ -154,6 +154,7 @@ const PlayView = ({ songId, type, route }: RouteProps) => { return; } setMidiKeyboardFound(true); + // eslint-disable-next-line @typescript-eslint/no-unused-vars let inputIndex = 0; webSocket.current = new WebSocket(scoroBaseApiUrl); webSocket.current.onopen = () => { @@ -192,7 +193,7 @@ const PlayView = ({ songId, type, route }: RouteProps) => { const points = data.info.score; const maxPoints = data.info.max_score || 1; - if (currentStreak && points) { + if (currentStreak !== undefined && points !== undefined) { setPianoMsgs({ type: 'scoreInfo', data: { streak: currentStreak, score: points },