resolving presets promise

This commit is contained in:
Ondřej Samohel 2020-04-21 19:31:24 +02:00
parent 45feed021a
commit 64fe76271c
2 changed files with 11 additions and 9 deletions

View file

@ -617,7 +617,6 @@ $.pype = {
*/
setProjectPreset: function (inPresets) {
// validating the incoming data are having `plugins` key
$.pype.log(inPresets.plugins);
if (Object.prototype.hasOwnProperty.call(inPresets, 'plugins')) {
$.pype.presets = inPresets;
return true;

View file

@ -23,15 +23,18 @@ class Pype {
this.csi.evalScript('$.pype.setEnvs(' + JSON.stringify(self.env) + ')');
this.pras = new PypeRestApiClient(this.env);
console.info(`Getting presets for ${this.env.AVALON_PROJECT}`);
this.presets = this.pras.get_presets(this.env.AVALON_PROJECT);
console.info("transferring presets to jsx")
this.csi.evalScript('$.pype.setProjectPreset(' + JSON.stringify(result) + ');', () => {
console.log("done");
// bind encoding jobs event listener
this.csi.addEventListener("pype.EncoderJobsComplete", this._encodingDone);
this.presets = this.pras.get_presets(this.env.AVALON_PROJECT)
.then((presets) => {
console.info("transferring presets to jsx")
this.presets = presets;
this.csi.evalScript('$.pype.setProjectPreset(' + JSON.stringify(presets) + ');', () => {
console.log("done");
// bind encoding jobs event listener
this.csi.addEventListener("pype.EncoderJobsComplete", this._encodingDone);
// Bind Interface buttons
this._bindButtons();
// Bind Interface buttons
this._bindButtons();
});
});
});
}