Skip to content

Commit

Permalink
add returns
Browse files Browse the repository at this point in the history
  • Loading branch information
JonasBa committed Sep 24, 2024
1 parent 6cbece3 commit 7108b5c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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]);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,12 @@ export function maybeFocusTraceRow(
node: TraceTreeNode<TraceTree.NodeValue>,
previouslyFocusedNodeRef: React.MutableRefObject<TraceTreeNode<TraceTree.NodeValue> | null>
) {
if (!ref) return;
if (node === previouslyFocusedNodeRef.current) return;
if (!ref) {
return;
}
if (node === previouslyFocusedNodeRef.current) {
return;
}

previouslyFocusedNodeRef.current = node;
ref.focus();
Expand Down

0 comments on commit 7108b5c

Please sign in to comment.