make onMixersChanged async so that it can await internally

This commit is contained in:
Seth Call 2022-08-17 21:57:54 -05:00
parent 794d131a3e
commit cbbfebddc9
3 changed files with 19 additions and 11 deletions

View File

@ -478,10 +478,10 @@
});
if (deferred) {
logger.log(
/** logger.log(
"[asyncJamClient] Message received via QWebChannel: " +
message
);
);*/
deferred.resolve(response);
//remove this deferred object from queue
deferredQueue = deferredQueue.filter(
@ -556,11 +556,13 @@
let deferred = new Deferred(appMessage.request_id);
/**
logger.log(
"[asyncJamClient] diverting to backend:",
prop,
appMessage
);
*/
if (jkfrontendchannel) {
try {

View File

@ -298,7 +298,7 @@ ConfigureTracksStore = @ConfigureTracksStore
const $select = $root.find('.instrument-pick');
const instrumentId = $select.val();
await ConfigureTracksActions.associateInstrumentWithTrack(instrumentId);
ConfigureTracksActions.associateInstrumentWithTrack.trigger(instrumentId);
}`
@ -465,4 +465,4 @@ ConfigureTracksStore = @ConfigureTracksStore
@setState({midiInterface: midiInterface})
})
})

View File

@ -51,10 +51,16 @@ void removeSearchPath(int typeId, QString pathToRemove);
editingTrackValid: () ->
true
onMixersChanged: (mixers) ->
@loadChannels()
@loadTrackInstruments()
@changed()
#onMixersChanged: (mixers) ->
# await @loadChannels()
# await @loadTrackInstruments()
# @changed()
onMixersChanged: `async function(mixers) {
await this.loadChannels();
await this.loadTrackInstruments();
this.changed();
}`
onPlatformChanged: (platform) ->
@platform = platform
@ -610,7 +616,7 @@ void removeSearchPath(int typeId, QString pathToRemove);
if (this.trackNumber == null) { return; }
logger.debug("context.jamClient.TrackSetInstrument(trackNumber, track.instrument_id)", this.trackNumber, instrumentId);
console.log("context.jamClient.TrackSetInstrument(trackNumber, track.instrument_id)", this.trackNumber, instrumentId);
let clientInstrumentId = null;
if ((instrumentId !== null) && (instrumentId !== '')) {
@ -622,7 +628,7 @@ void removeSearchPath(int typeId, QString pathToRemove);
await context.jamClient.TrackSetInstrument(this.trackNumber, clientInstrumentId);
if (this.trackNumber === MIDI_TRACK) {
logger.debug("checking midi track for track instrument synchronization");
console.log("checking midi track for track instrument synchronization");
// keep artificial midi track in sync
const midi = this.findMidiTrack();
if (midi != null) {
@ -961,4 +967,4 @@ void removeSearchPath(int typeId, QString pathToRemove);
}`
}
)
)