Fixed issue with actionlist autocompletion

This commit is contained in:
frikky
2022-02-11 00:23:34 +01:00
parent 349449e903
commit 65418b39c4
5 changed files with 27 additions and 7 deletions
+8 -2
View File
@@ -488,7 +488,7 @@ const ParsedAction = (props) => {
continue;
}
var exampledata = item.example === undefined ? "" : item.example;
var exampledata = item.example === undefined || item.example === null ? "" : item.example;
// Find previous execution and their variables
//exampledata === "" &&
if (workflowExecutions.length > 0) {
@@ -505,10 +505,14 @@ const ParsedAction = (props) => {
var foundResult = workflowExecutions[key].results.find(
(result) => result.action.id === item.id
);
if (foundResult === undefined) {
if (foundResult === undefined || foundResult === null) {
continue;
}
if (foundResult.result !== undefined && foundResult.result !== null) {
foundResult = foundResult.result
}
const valid = validateJson(foundResult)
if (valid.valid) {
exampledata = valid.result;
@@ -524,6 +528,7 @@ const ParsedAction = (props) => {
item.label === null || item.label === undefined
? ""
: item.label.split(" ").join("_");
const actionvalue = {
type: "action",
id: item.id,
@@ -535,6 +540,7 @@ const ParsedAction = (props) => {
}
}
console.log("ACTIONLIST: ", actionlist)
setActionlist(actionlist);
}
}