Skip to content

Commit

Permalink
fix: checkOscCommand - returned always true
Browse files Browse the repository at this point in the history
  • Loading branch information
olzzon committed Nov 27, 2019
1 parent 69b1953 commit d502820
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/utils/OscMixerConnection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -222,18 +222,18 @@ export class OscMixerConnection {
if (message === command) return true;
let messageArray: string[] = message.split('/')
let commandArray: string[] = command.split('/')
let status: boolean = true

commandArray.forEach((commandPart: string, index: number) => {
if (commandPart === '{channel}') {
if (typeof(parseFloat(messageArray[index])) !== 'number') { return false }
if (typeof(parseFloat(messageArray[index])) !== 'number') { status = false }
} else if (commandPart === '{argument}') {
if (typeof(parseFloat(messageArray[index])) !== 'number') { return false }
if (typeof(parseFloat(messageArray[index])) !== 'number') { status = false }
} else if (commandPart !== messageArray[index]) {
return false
status = false
}
})

return true
return status
}

sendOutMessage(oscMessage: string, channel: number, value: string | number, type: string) {
Expand Down

0 comments on commit d502820

Please sign in to comment.