diff --git a/src/frontend/src/CustomNodes/GenericNode/components/outputModal/components/switchOutputView/index.tsx b/src/frontend/src/CustomNodes/GenericNode/components/outputModal/components/switchOutputView/index.tsx index 7f3ed00bf..10e85f004 100644 --- a/src/frontend/src/CustomNodes/GenericNode/components/outputModal/components/switchOutputView/index.tsx +++ b/src/frontend/src/CustomNodes/GenericNode/components/outputModal/components/switchOutputView/index.tsx @@ -25,7 +25,7 @@ const SwitchOutputView: React.FC = ({ const flowPoolNode = (flowPool[nodeId] ?? [])[ (flowPool[nodeId]?.length ?? 1) - 1 ]; - let results = (flowPoolNode?.data?.logs[outputName] ?? [])[0] ?? ""; + let results = flowPoolNode?.data?.logs[outputName] ?? ""; if (Array.isArray(results)) { console.error("Log results are an array", results); return; diff --git a/src/frontend/src/CustomNodes/GenericNode/components/parameterComponent/index.tsx b/src/frontend/src/CustomNodes/GenericNode/components/parameterComponent/index.tsx index dcf6f53d8..6b360796d 100644 --- a/src/frontend/src/CustomNodes/GenericNode/components/parameterComponent/index.tsx +++ b/src/frontend/src/CustomNodes/GenericNode/components/parameterComponent/index.tsx @@ -92,7 +92,7 @@ export default function ParameterComponent({ const logHasMessage = (data: any) => { if (!outputName) return; - const logs = (data?.logs[outputName] ?? [])[0]; + const logs = data?.logs[outputName]; if (Array.isArray(logs) && logs.length > 1) { return logs.some((log) => log.message); } else { @@ -102,7 +102,7 @@ export default function ParameterComponent({ const logTypeIsUnknown = (data: any) => { if (!outputName) return; - const logs = (data?.logs[outputName] ?? [])[0]; + const logs = data?.logs[outputName]; if (Array.isArray(logs) && logs.length > 1) { return logs.some((log) => log.type === "unknown"); } else { @@ -112,7 +112,7 @@ export default function ParameterComponent({ const logTypeIsError = (data: any) => { if (!outputName) return; - const logs = (data?.logs[outputName] ?? [])[0]; + const logs = data?.logs[outputName]; if (Array.isArray(logs) && logs.length > 1) { return logs.some( (log) => log.type === "error" || log.type === "ValueError", @@ -131,7 +131,7 @@ export default function ParameterComponent({ let hasOutputs; if (flowPoolNode?.data?.logs && outputName) { - hasOutputs = (flowPoolNode?.data?.logs[outputName] ?? [])[0] ?? null; + hasOutputs = flowPoolNode?.data?.logs[outputName] ?? null; } const unknownOutput = logTypeIsUnknown(flowPoolNode?.data); diff --git a/src/frontend/src/CustomNodes/hooks/use-validation-status-string.tsx b/src/frontend/src/CustomNodes/hooks/use-validation-status-string.tsx index 1f957df55..30457090e 100644 --- a/src/frontend/src/CustomNodes/hooks/use-validation-status-string.tsx +++ b/src/frontend/src/CustomNodes/hooks/use-validation-status-string.tsx @@ -7,15 +7,10 @@ const useValidationStatusString = (validationStatus: VertexBuildTypeAPI, setVali // if it is not a string turn it into a string console.log("validationStatus", validationStatus); let newValidationString = ""; - Object.values(validationStatus?.data?.logs).forEach((log: LogType | LogType[]) => { - if (!Array.isArray(log)) { - log = [log]; - } - log.forEach((logItem) => { - if (logItem.type === "error" || logItem.type === "ValueError") { - newValidationString += `${logItem.message}\n`; + Object.values(validationStatus?.data?.logs).forEach((log: any) => { + if (log.type === "error" || log.type === "ValueError") { + newValidationString += `${log.message}\n`; } - }); }); setValidationString(newValidationString); }