Skip to content

Commit

Permalink
Fix: checkOSC command, if {channel} was last parameter in command it …
Browse files Browse the repository at this point in the history
…returned false
  • Loading branch information
olzzon committed May 21, 2019
1 parent 4512985 commit c959bf0
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions src/utils/OscMixerConnection.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,15 +177,21 @@ export class OscMixerConnection {
if (message === command) return true;

let cmdArray = command.split("{channel}");
if (
message.substr(0, cmdArray[0].length) === cmdArray[0] &&
message.substr(-cmdArray[1].length) === cmdArray[1] &&
message.length >= command.replace("{channel}", "").length
) {
return true;
} else {
return false;
if (message.substr(0, cmdArray[0].length) === cmdArray[0])
{
if (
message.substr(-cmdArray[1].length) === cmdArray[1] &&
message.length >= command.replace("{channel}", "").length
) {
return true;
} else if (
cmdArray[1] = "" &&
message.length >= command.replace("{channel}", "").length
) {
return true;
}
}
return false;
}

sendOutMessage(oscMessage, channel, value, type) {
Expand Down

0 comments on commit c959bf0

Please sign in to comment.