From eae1adc842ef5c8ce7ec3b737af15f9fb5d37f3c Mon Sep 17 00:00:00 2001 From: Jakub Jezek Date: Thu, 23 Apr 2020 11:43:55 +0200 Subject: [PATCH] feat(ppro): removing paths from ui after success publish --- pype/premiere/ppro/js/pype.js | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/pype/premiere/ppro/js/pype.js b/pype/premiere/ppro/js/pype.js index 0eb0ca62ae..c78e3ef5e2 100644 --- a/pype/premiere/ppro/js/pype.js +++ b/pype/premiere/ppro/js/pype.js @@ -171,7 +171,6 @@ class Pype { }); }); } - publish() { this._gatherPublishUI(); if (this.publishUI.jsonSendPath === "") { @@ -201,9 +200,6 @@ class Pype { }, error => { console.error(`failed to publish: ${error}`); }); - // here jsonSetPath and jsonGetPath are set to gui - this.uiJsonSendPath.value = ""; - this.uiJsonGetPath.value = ""; console.log("waiting for result"); }); } else { @@ -213,11 +209,10 @@ class Pype { .then((result) => { const fs = require('fs'); if (fs.existsSync(result.return_data_path)) { - this.csi.evalScript('$.pype.dumpPublishedInstancesToMetadata(' + JSON.stringify(result) + ');'); - if (this.publishUI.versionUp) { - console.log('Saving new version of the project file'); - this.csi.evalScript('$.pype.versionUpWorkFile();'); - } + if (this.publishUI.versionUp) { + console.log('Saving new version of the project file'); + this.csi.evalScript('$.pype.versionUpWorkFile();'); + } } else { console.error("Publish has not finished correctly") throw "Publish has not finished correctly"; @@ -227,6 +222,9 @@ class Pype { } _encodingDone(event) { + var publishId = document.querySelector('#publish'); + var uiJsonSendPath = publishId.querySelector('input[name=send-path]'); + var uiJsonGetPath = publishId.querySelector('input[name=get-path]'); // this will be global in this context console.log("Event recieved ..."); var dataToPublish = { @@ -251,7 +249,10 @@ class Pype { if (this.pype.publishUI.versionUp) { console.log('Saving new version of the project file'); this.pype.csi.evalScript('$.pype.versionUpWorkFile();'); - } + }; + // here jsonSetPath and jsonGetPath are set to gui + uiJsonSendPath.value = ""; + uiJsonGetPath.value = ""; console.log("Publishing done."); } else { console.error("Publish has not finished correctly")