Skip to content
Snippets Groups Projects
Commit bde8fd95 authored by David Huss's avatar David Huss :speech_balloon:
Browse files

Source selector won't send command if already active

parent 3a905b26
Branches
No related tags found
No related merge requests found
......@@ -306,6 +306,14 @@ class SourceSelector {
button.textContent = this.name;
button.source_selector = this;
button.addEventListener("click", function(event) {
if (event.target.classList.contains("active")) {
console.log(`Did not send switch command (${command}): was already active`);
return;
}
if (event.target.classList.contains("requested")) {
console.log(`Did not send switch command (${command}): was already requested`);
return;
}
let source_selector = event.target.source_selector;
let command = "switch-video";
ws2.send(JSON.stringify({command: command, number: source_selector.number}));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment