From 61b58eddd17eaa160e64961b9fe5f93685326925 Mon Sep 17 00:00:00 2001 From: Nuwan Date: Tue, 5 Sep 2023 19:19:16 +0530 Subject: [PATCH] prevent showing alert on audio instrument select fix this bug due to previous introduction of alert which pops up if midi instrument is selected without selecting midi interface and vst plugin. The alert only applicable to the midi interface. --- .../ConfigureLiveTracksDialog.js.jsx.coffee | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/web/app/assets/javascripts/react-components/ConfigureLiveTracksDialog.js.jsx.coffee b/web/app/assets/javascripts/react-components/ConfigureLiveTracksDialog.js.jsx.coffee index 7df36ee66..c023979f5 100644 --- a/web/app/assets/javascripts/react-components/ConfigureLiveTracksDialog.js.jsx.coffee +++ b/web/app/assets/javascripts/react-components/ConfigureLiveTracksDialog.js.jsx.coffee @@ -110,7 +110,7 @@ ConfigureTracksStore = @ConfigureTracksStore

Instrument

- {instruments}
@@ -188,7 +188,7 @@ ConfigureTracksStore = @ConfigureTracksStore

Instrument Display Name

- {instruments}
@@ -295,16 +295,21 @@ ConfigureTracksStore = @ConfigureTracksStore @setState({midiInterface: null}) - instrumentSelected: (e) -> + audioInstrumentSelected: (e) -> $root = $(@getDOMNode()) instrumentId = $root.find('.instrument-pick').val() + ConfigureTracksActions.associateInstrumentWithTrack(instrumentId) + + midiInstrumentSelected: (e) -> + $root = $(@getDOMNode()) + midiInstrumentId = $root.find('.midi-instrument-pick').val() midiSelVal = $root.find('.midi-select').val() vstsSelVal = $root.find('.vsts').val() if midiSelVal == "" || vstsSelVal == "NONE" context.JK.Banner.showAlert("MIDI interface and MIDI plugin must be selected.") else - ConfigureTracksActions.associateInstrumentWithTrack(instrumentId) + ConfigureTracksActions.associateInstrumentWithTrack(midiInstrumentId) # instrumentSelected: `async function(e) { # const $root = $(this.getDOMNode()); @@ -391,7 +396,8 @@ ConfigureTracksStore = @ConfigureTracksStore context.JK.dropdown($root.find('select')); $root.find('select.input-selectors').unbind('change').change(this.inputChanged); - $root.find('select.instrument-pick').unbind('change').change(this.instrumentSelected); + $root.find('select.instrument-pick').unbind('change').change(this.audioInstrumentSelected); + $root.find('select.midi-instrument-pick').unbind('change').change(this.midiInstrumentSelected); $root.find('select.vsts').unbind('change').change(this.vstsChanged); $root.find('select.midi-select').unbind('change').change(this.midiInterfaceChanged); }