From 359ccfe431ae465be3f539fe9366d66b47d29ca3 Mon Sep 17 00:00:00 2001 From: Nuwan Date: Thu, 23 Feb 2023 19:12:16 +0530 Subject: [PATCH] fix async call order in configure audio This error was appearing in audio gear configuration when clicking Next button in select & test audio gear step. on this button click the program executed an event listener on input channel check box click (programmatically) and autoAssignToSingleInput inside the click event handler was invoked an async call stack which was resolved before the next button click handler completed. As a result a pop up was showing up saying "The application is no longer modifying a new profile". This commits fixes this issue by explicitly preventing this event lister handler been executed in this case. --- web/app/assets/javascripts/wizard/gear/step_select_gear.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/web/app/assets/javascripts/wizard/gear/step_select_gear.js b/web/app/assets/javascripts/wizard/gear/step_select_gear.js index 454aad555..0afd0f3c0 100644 --- a/web/app/assets/javascripts/wizard/gear/step_select_gear.js +++ b/web/app/assets/javascripts/wizard/gear/step_select_gear.js @@ -1128,7 +1128,6 @@ } async function handleNext() { - var $assignedInputs = $inputChannels.find('input[type="checkbox"]:checked'); var $assignedOutputs = $outputChannels.find('input[type="checkbox"]:checked'); @@ -1194,7 +1193,9 @@ return; } var $unassignedInputs = $inputChannels.find('input[type="checkbox"]:not(:checked)') + iCheckIgnore = true; $allInputs.eq(0).iCheck('check').attr('checked', 'checked') + iCheckIgnore = false; var maxTries = 36; for(var i = 0; i < maxTries; i++) { @@ -1212,7 +1213,9 @@ } else { // the goal of this loop is to just uncheck one. once it's done that, it breaks the loop, so that assigned can be fetched again + iCheckIgnore = true; $node.iCheck('uncheck').removeAttr('checked') + iCheckIgnore = false; return false; } }) @@ -1324,7 +1327,6 @@ } async function assertFTUEProfile() { - if(savedProfile) {return;} // once we save the profile, it's name no longer starts with FTUE var profileName = await context.jamClient.FTUEGetMusicProfileName(); if(profileName && profileName.indexOf('FTUE') != 0) {