diff --git a/static/helpers.js b/static/helpers.js index da6432e49fde7f4f4df1ef9f812cec877ac36519..88b46500a37b735208cb808e8925bd36a9276713 100755 --- a/static/helpers.js +++ b/static/helpers.js @@ -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}));