diff --git a/front/models/SongHistory.ts b/front/models/SongHistory.ts index bec25bd..6d4510e 100644 --- a/front/models/SongHistory.ts +++ b/front/models/SongHistory.ts @@ -6,7 +6,7 @@ import { SongValidator } from './Song'; export const SongHistoryItemValidator = yup .object({ songID: yup.number().required(), - song: SongValidator.optional(), + song: SongValidator.optional().default(undefined), userID: yup.number().required(), info: yup .object({ diff --git a/front/views/PlayView.tsx b/front/views/PlayView.tsx index 7ad4b75..30ff45d 100644 --- a/front/views/PlayView.tsx +++ b/front/views/PlayView.tsx @@ -147,9 +147,10 @@ const PlayView = ({ songId, route }: RouteProps) => { const onMIDISuccess = (access: MIDIAccess) => { const inputs = access.inputs; + console.log('MIDI inputs', inputs); let endMsgReceived = false; // Used to know if to go to error screen when websocket closes - if (inputs.size < 2) { + if (inputs.size <= 0) { toast.show({ description: 'No MIDI Keyboard found' }); return; } @@ -232,7 +233,6 @@ const PlayView = ({ songId, route }: RouteProps) => { }; inputs.forEach((input) => { input.onmidimessage = (message) => { - console.log('onmessage'); const { command, note } = parseMidiMessage(message); const keyIsPressed = command == 9;