From 443c9ac56c965f4a24c66f9618c26be8e1f5ddcb Mon Sep 17 00:00:00 2001 From: Robert Date: Wed, 16 Aug 2023 13:38:03 +0100 Subject: [PATCH] Inline some rendering in AlertTablePathNodeRow --- .../view/results/AlertTablePathNodeRow.tsx | 46 +++++++++---------- 1 file changed, 21 insertions(+), 25 deletions(-) diff --git a/extensions/ql-vscode/src/view/results/AlertTablePathNodeRow.tsx b/extensions/ql-vscode/src/view/results/AlertTablePathNodeRow.tsx index 46a3febc7..9a972baed 100644 --- a/extensions/ql-vscode/src/view/results/AlertTablePathNodeRow.tsx +++ b/extensions/ql-vscode/src/view/results/AlertTablePathNodeRow.tsx @@ -37,29 +37,6 @@ export function AlertTablePathNodeRow(props: Props) { pathIndex, pathNodeIndex, }; - const msg = - step.location !== undefined && step.location.message !== undefined ? ( - - ) : ( - "[no location]" - ); - const additionalMsg = - step.location !== undefined ? ( - - ) : ( - "" - ); const isSelected = Keys.equalsNotUndefined(selectedItem, pathNodeKey); const stepIndex = pathNodeIndex + 1; // Convert to 1-based const zebraIndex = resultIndex + stepIndex; @@ -83,7 +60,19 @@ export function AlertTablePathNodeRow(props: Props) { > {stepIndex} - {msg} + + {step.location && step.location.message ? ( + + ) : ( + "[no location]" + )} + - {additionalMsg} + {step.location && ( + + )} );