From 137f8ad4cb7b0d56af7c6603c88dd844fdfb571b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Lov=C3=A9n?= Date: Wed, 7 Jul 2021 21:39:33 +0000 Subject: [PATCH] Revert "Colorize trace paths for choose without explicit default case" This reverts commit c1f462b8f8c5582ba9448bdea5da5173d23faea8. --- src/components/trace/hat-script-graph.ts | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/src/components/trace/hat-script-graph.ts b/src/components/trace/hat-script-graph.ts index 815e7ba72..4a42c5604 100644 --- a/src/components/trace/hat-script-graph.ts +++ b/src/components/trace/hat-script-graph.ts @@ -143,12 +143,11 @@ class HatScriptGraph extends LitElement { graphStart = false ) { const trace = this.trace.trace[path] as ChooseActionTraceStep[] | undefined; - const trace_path = - trace !== undefined - ? trace[0].result?.choice === "default" || trace[0].result === undefined - ? [Array.isArray(config.choose) ? config.choose.length : 0] - : [trace[0].result.choice] - : []; + const trace_path = trace?.[0].result + ? trace[0].result.choice === "default" + ? [Array.isArray(config.choose) ? config.choose.length : 0] + : [trace[0].result.choice] + : []; return html` ${ensureArray(config.default)?.map((action, i) =>