Fixes of HIGH quality
This commit is contained in:
@@ -6,7 +6,7 @@ import { SongValidator } from './Song';
|
|||||||
export const SongHistoryItemValidator = yup
|
export const SongHistoryItemValidator = yup
|
||||||
.object({
|
.object({
|
||||||
songID: yup.number().required(),
|
songID: yup.number().required(),
|
||||||
song: SongValidator.optional(),
|
song: SongValidator.optional().default(undefined),
|
||||||
userID: yup.number().required(),
|
userID: yup.number().required(),
|
||||||
info: yup
|
info: yup
|
||||||
.object({
|
.object({
|
||||||
|
|||||||
@@ -147,9 +147,10 @@ const PlayView = ({ songId, route }: RouteProps<PlayViewProps>) => {
|
|||||||
|
|
||||||
const onMIDISuccess = (access: MIDIAccess) => {
|
const onMIDISuccess = (access: MIDIAccess) => {
|
||||||
const inputs = access.inputs;
|
const inputs = access.inputs;
|
||||||
|
console.log('MIDI inputs', inputs);
|
||||||
let endMsgReceived = false; // Used to know if to go to error screen when websocket closes
|
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' });
|
toast.show({ description: 'No MIDI Keyboard found' });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -232,7 +233,6 @@ const PlayView = ({ songId, route }: RouteProps<PlayViewProps>) => {
|
|||||||
};
|
};
|
||||||
inputs.forEach((input) => {
|
inputs.forEach((input) => {
|
||||||
input.onmidimessage = (message) => {
|
input.onmidimessage = (message) => {
|
||||||
console.log('onmessage');
|
|
||||||
const { command, note } = parseMidiMessage(message);
|
const { command, note } = parseMidiMessage(message);
|
||||||
const keyIsPressed = command == 9;
|
const keyIsPressed = command == 9;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user