From 9310afc8e2fbfcf17ef46cb4976b47d93bb99bb6 Mon Sep 17 00:00:00 2001 From: Stephen Smith Date: Fri, 21 Oct 2022 14:33:02 -0400 Subject: [PATCH] 16073: Avoid applying empty inputs when existing inputs already loaded Arvados-DCO-1.1-Signed-off-by: Stephen Smith --- src/views/process-panel/process-panel-root.tsx | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/views/process-panel/process-panel-root.tsx b/src/views/process-panel/process-panel-root.tsx index 248c5215..6b88e261 100644 --- a/src/views/process-panel/process-panel-root.tsx +++ b/src/views/process-panel/process-panel-root.tsx @@ -109,11 +109,15 @@ export const ProcessPanelRoot = withStyles(styles)( // Can be sync because inputs are either already in containerRequest mounts or props React.useEffect(() => { if (containerRequest) { - const rawInputs = getRawInputs(containerRequest); - setInputs(rawInputs); - - const inputs = getInputs(containerRequest); - setProcessedInputs(formatInputData(inputs, auth)); + // Since mounts can disappear and reappear, only set inputs if raw / processed inputs is undefined or new inputs has content + const newRawInputs = getRawInputs(containerRequest); + if (rawInputs === undefined || newRawInputs && newRawInputs.length) { + setInputs(newRawInputs); + } + const newInputs = getInputs(containerRequest); + if (processedInputs === undefined || newInputs && newInputs.length) { + setProcessedInputs(formatInputData(newInputs, auth)); + } } }, [requestUuid, auth, containerRequest]); -- 2.30.2