Update WorkflowCollection.js

This commit is contained in:
JAlB- 2023-03-28 23:16:52 +03:00 committed by GitHub
parent 7992127c6f
commit a9f6fb7cf9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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);
});
}