From 9d64423ba06b28d142f1c9454441b682cb78f17e Mon Sep 17 00:00:00 2001 From: joaovictor3g Date: Wed, 24 Apr 2024 14:21:06 -0300 Subject: [PATCH] hides accordions when an error is given --- web/assets/js/main.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/web/assets/js/main.js b/web/assets/js/main.js index cc89635..313daa1 100644 --- a/web/assets/js/main.js +++ b/web/assets/js/main.js @@ -16,7 +16,10 @@ import { setCost } from "./utils/render-functions.js"; import { AceEditor } from "./editor.js"; -import { handleRenderAccordions } from "./components/accordions/result.js"; +import { + handleRenderAccordions, + hideAccordions, +} from "./components/accordions/result.js"; import { localStorageModeKey } from "./constants.js"; import { setEditorTheme } from "./theme.js"; import { getExprEditorValue, getInputEditorValue } from "./utils/editor.js"; @@ -68,6 +71,7 @@ function run() { if (isError) { output.value = resultOutput; output.style.color = "red"; + hideAccordions(); } else { const obj = JSON.parse(resultOutput); const resultCost = obj?.cost;