From c07f6999ca57fcf68fcfb803e2bf957d578c92f5 Mon Sep 17 00:00:00 2001 From: Josh Hawkins <32435876+hawkeye217@users.noreply.github.com> Date: Mon, 27 May 2024 10:31:58 -0500 Subject: [PATCH] refresh editor value when config is updated (#11559) --- web/src/pages/ConfigEditor.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/web/src/pages/ConfigEditor.tsx b/web/src/pages/ConfigEditor.tsx index ea89d32fb..55df04e34 100644 --- a/web/src/pages/ConfigEditor.tsx +++ b/web/src/pages/ConfigEditor.tsx @@ -29,7 +29,7 @@ function ConfigEditor() { const [error, setError] = useState(); const editorRef = useRef(null); - const modelRef = useRef(null); + const modelRef = useRef(null); const configRef = useRef(null); const onHandleSaveConfig = useCallback( @@ -124,6 +124,12 @@ function ConfigEditor() { }; }); + useEffect(() => { + if (config && modelRef.current) { + modelRef.current.setValue(config); + } + }, [config]); + if (!config) { return ; }