From 7108b5cccdd335236d18e8e571be5faa8fe420ca Mon Sep 17 00:00:00 2001 From: JonasBa Date: Mon, 23 Sep 2024 21:49:40 -0400 Subject: [PATCH] add returns --- .../newTraceDetails/traceRow/traceBackgroundPatterns.tsx | 9 +++++++-- .../performance/newTraceDetails/traceRow/traceRow.tsx | 8 ++++++-- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/static/app/views/performance/newTraceDetails/traceRow/traceBackgroundPatterns.tsx b/static/app/views/performance/newTraceDetails/traceRow/traceBackgroundPatterns.tsx index fc5fe509aac09..e952b9f7a699e 100644 --- a/static/app/views/performance/newTraceDetails/traceRow/traceBackgroundPatterns.tsx +++ b/static/app/views/performance/newTraceDetails/traceRow/traceBackgroundPatterns.tsx @@ -31,12 +31,17 @@ interface BackgroundPatternsProps { export function TraceBackgroundPatterns(props: BackgroundPatternsProps) { const performance_issues = useMemo(() => { - if (!props.performance_issues.size) return []; + if (!props.performance_issues.size) { + return []; + } + return [...props.performance_issues]; }, [props.performance_issues]); const errors = useMemo(() => { - if (!props.errors.size) return []; + if (!props.errors.size) { + return []; + } return [...props.errors]; }, [props.errors]); diff --git a/static/app/views/performance/newTraceDetails/traceRow/traceRow.tsx b/static/app/views/performance/newTraceDetails/traceRow/traceRow.tsx index 6bb7d46e19e27..fa268f3568673 100644 --- a/static/app/views/performance/newTraceDetails/traceRow/traceRow.tsx +++ b/static/app/views/performance/newTraceDetails/traceRow/traceRow.tsx @@ -58,8 +58,12 @@ export function maybeFocusTraceRow( node: TraceTreeNode, previouslyFocusedNodeRef: React.MutableRefObject | null> ) { - if (!ref) return; - if (node === previouslyFocusedNodeRef.current) return; + if (!ref) { + return; + } + if (node === previouslyFocusedNodeRef.current) { + return; + } previouslyFocusedNodeRef.current = node; ref.focus();