From a9e587c76163026be7219645399d3d25420ba809 Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Sun, 24 Apr 2022 18:19:10 +0200 Subject: [PATCH] scaffolder: fix template dry run results panel not expanding on first show Signed-off-by: Patrik Oldsberg --- .../TemplateEditorPage/TemplateEditorDryRunResults.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/scaffolder/src/components/TemplateEditorPage/TemplateEditorDryRunResults.tsx b/plugins/scaffolder/src/components/TemplateEditorPage/TemplateEditorDryRunResults.tsx index 756bf8421c..3e82c62aa1 100644 --- a/plugins/scaffolder/src/components/TemplateEditorPage/TemplateEditorDryRunResults.tsx +++ b/plugins/scaffolder/src/components/TemplateEditorPage/TemplateEditorDryRunResults.tsx @@ -112,15 +112,15 @@ const useStyles = makeStyles((theme: BackstageTheme) => ({ export function TemplateEditorDryRunResults() { const classes = useStyles(); const dryRun = useDryRun(); - const [expanded, setExpanded] = useState(true); + const [expanded, setExpanded] = useState(false); const [hidden, setHidden] = useState(true); const resultsLength = dryRun.results.length; const prevResultsLength = usePrevious(resultsLength); useEffect(() => { if (prevResultsLength === 0 && resultsLength === 1) { - setExpanded(true); setHidden(false); + setExpanded(true); } else if (prevResultsLength === 1 && resultsLength === 0) { setExpanded(false); }