Fixed a bug when current streak is 0 and Linter fix

This commit is contained in:
Clément Le Bihan
2023-09-14 17:28:01 +02:00
parent 58d761c359
commit 073c00a35e

View File

@@ -154,6 +154,7 @@ const PlayView = ({ songId, type, route }: RouteProps<PlayViewProps>) => {
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<PlayViewProps>) => {
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 },