From a9f6fb7cf9651255c9ead53737e3588894b44195 Mon Sep 17 00:00:00 2001 From: JAlB- Date: Tue, 28 Mar 2023 23:16:52 +0300 Subject: [PATCH] Update WorkflowCollection.js --- web/scripts/WorkflowCollection.js | 40 +++++++++++++++++-------------- 1 file changed, 22 insertions(+), 18 deletions(-) diff --git a/web/scripts/WorkflowCollection.js b/web/scripts/WorkflowCollection.js index ab28db03b..b39574dfd 100644 --- a/web/scripts/WorkflowCollection.js +++ b/web/scripts/WorkflowCollection.js @@ -125,24 +125,6 @@ class WC{ lsSet('WorkflowCollection', jsonEncode(DATA)); } if (lsGet('WorkflowCollection') == null) { - fetch('DefaultWorkflows.json') - .then( - function(response) { - if (response.status !== 200) { - console.log('Looks like there was a problem. Status Code: ' + - response.status); - return; - } - - // Examine the text in the response - response.json().then(function(data) { - DEFAULT_COLLECTIONS = data; - }); - } - ) - .catch(function(err) { - console.log('Fetch Error :-S', err); - }); lsSet('WorkflowCollection', jsonEncode(DEFAULT_COLLECTIONS)); } let data = jsonDecode(lsGet('WorkflowCollection')); @@ -230,3 +212,25 @@ class OPE{ wc = new WC(qs('body')); ope = new OPE(qs('body')); + +if (lsGet('WorkflowCollection') == null) { + fetch('DefaultWorkflows.json') + .then( + function(response) { + if (response.status !== 200) { + console.log('Looks like there was a problem. Status Code: ' + + response.status); + return; + } + // Examine the text in the response + response.json().then(function(data) { + DEFAULT_COLLECTIONS = data; + lsSet('WorkflowCollection', jsonEncode(DEFAULT_COLLECTIONS)); + ws.load(); + }); + } + ) + .catch(function(err) { + console.log('Fetch Error :-S', err); + }); +}