diff --git a/app/assets/javascripts/configureTrack.js b/app/assets/javascripts/configureTrack.js index 69f5cc0d6..468ee6120 100644 --- a/app/assets/javascripts/configureTrack.js +++ b/app/assets/javascripts/configureTrack.js @@ -430,11 +430,8 @@ var chatOption = $('#voice-chat-type').val(); if (chatOption == VOICE_CHAT.SESSION) { - $('#audio-inputs-unused > option').each(function() { - if ($('#voice-inputs-unused > option[value="' + this.value + '"]').length === 0) { - $('#voice-inputs-unused').append(''); - } - }); + context.JK.loadOptions($('#template-option').html(), $('#voice-inputs-unused'), chatUnassignedList, "id", "name", -1); + context.JK.loadOptions($('#template-option').html(), $('#voice-inputs-selection'), chatAssignedList, "id", "name", -1); } // populate with voice devices @@ -767,6 +764,14 @@ context.jamClient.TrackLoadAssignments(); initDialogData(); + + var $option1 = $('#voice-chat-type > option[value="1"]'); + + // remove Session Audio option from voice chat if none are available + if (chatUnassignedList.length === 0 && originalVoiceChat != VOICE_CHAT.SESSION) { + logger.debug("Removing Option 1 from Voice Chat dropdown."); + $option1.remove(); + } } this.initialize = function() {