VRFS-662 voice chat settings bug after clicking Cancel
This commit is contained in:
parent
79c37f5434
commit
c38344e8e0
|
|
@ -283,13 +283,18 @@
|
|||
|
||||
function voiceChatChanged() {
|
||||
var voiceChatVal = $('#voice-chat-type').val();
|
||||
logger.debug("voiceChatVal=" + voiceChatVal);
|
||||
if (voiceChatVal == VOICE_CHAT.NO_CHAT) {
|
||||
logger.debug("VOICE_CHAT.NO_CHAT");
|
||||
_addSelectedVoiceInputsToMusicInputs();
|
||||
|
||||
$('#voice-inputs-unused').empty();
|
||||
$('#voice-inputs-selection').empty();
|
||||
}
|
||||
else if (voiceChatVal == VOICE_CHAT.CHAT) {
|
||||
logger.debug("VOICE_CHAT.CHAT");
|
||||
_addSelectedVoiceInputsToMusicInputs();
|
||||
|
||||
$('#voice-inputs-unused').empty();
|
||||
$('#voice-inputs-selection').empty();
|
||||
|
||||
|
|
@ -297,6 +302,8 @@
|
|||
context.JK.loadOptions($('#template-option').html(), $('#voice-inputs-selection'), chatOtherAssignedList, "id", "name", -1);
|
||||
}
|
||||
else if (voiceChatVal == VOICE_CHAT.SESSION) {
|
||||
logger.debug("VOICE_CHAT.SESSION");
|
||||
|
||||
$('#voice-inputs-unused').empty();
|
||||
$('#voice-inputs-selection').empty();
|
||||
|
||||
|
|
@ -307,6 +314,7 @@
|
|||
});
|
||||
}
|
||||
else if (voiceChatVal == VOICE_CHAT.MIC) {
|
||||
logger.debug("VOICE_CHAT.MIC");
|
||||
_addSelectedVoiceInputsToMusicInputs();
|
||||
|
||||
$('#voice-inputs-unused').empty();
|
||||
|
|
@ -633,6 +641,7 @@
|
|||
|
||||
function saveVoiceChatSettings() {
|
||||
currentVoiceChat = $('#voice-chat-type').val();
|
||||
originalVoiceChat = currentVoiceChat;
|
||||
|
||||
logger.debug("Calling TrackSetChatUsesMusic with value = " + currentVoiceChat);
|
||||
context.jamClient.TrackSetChatUsesMusic(currentVoiceChat);
|
||||
|
|
@ -651,8 +660,13 @@
|
|||
}
|
||||
|
||||
function cancelSettings() {
|
||||
logger.debug("Cancel settings");
|
||||
|
||||
// reset to original device ID
|
||||
context.jamClient.TrackSetMusicDevice(originalDeviceId);
|
||||
|
||||
$('#voice-chat-type').val(originalVoiceChat);
|
||||
currentVoiceChat = originalVoiceChat;
|
||||
}
|
||||
|
||||
function validateAudioSettings(allowEmptyInput) {
|
||||
|
|
@ -720,15 +734,15 @@
|
|||
return isValid;
|
||||
}
|
||||
else {
|
||||
currentVoiceChat = $('#voice-chat-type').val();
|
||||
if (currentVoiceChat == VOICE_CHAT.SESSION || currentVoiceChat == VOICE_CHAT.CHAT) {
|
||||
var chatType = $('#voice-chat-type').val();
|
||||
if (chatType == VOICE_CHAT.SESSION || chatType == VOICE_CHAT.CHAT) {
|
||||
var $voiceInputSelection = $('#voice-inputs-selection > option');
|
||||
if ($voiceInputSelection.size() === 0 || $voiceInputSelection.size() > 2) {
|
||||
errMsg = noTrackErrMsg;
|
||||
isValid = false;
|
||||
}
|
||||
}
|
||||
else if (currentVoiceChat == VOICE_CHAT.MIC || currentVoiceChat == VOICE_CHAT.NO_CHAT) {
|
||||
else if (chatType == VOICE_CHAT.MIC || chatType == VOICE_CHAT.NO_CHAT) {
|
||||
// NO VALIDATION NEEDED
|
||||
}
|
||||
|
||||
|
|
@ -760,6 +774,7 @@
|
|||
});
|
||||
|
||||
originalVoiceChat = context.jamClient.TrackGetChatUsesMusic();
|
||||
currentVoiceChat = originalVoiceChat;
|
||||
$('#voice-chat-type').val(originalVoiceChat);
|
||||
|
||||
logger.debug("originalVoiceChat=" + originalVoiceChat);
|
||||
|
|
|
|||
Loading…
Reference in New Issue