Skip to content

Commit a4cd175

Browse files
Remove commitRootId from CommitInfo
1 parent f52a5db commit a4cd175

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

src/view/components/profiler/components/CommitInfo/CommitInfo.tsx

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,17 @@ export function CommitInfo() {
99
const commit = useObserver(() => store.profiler.activeCommit.$);
1010
const isRecording = useObserver(() => store.profiler.isRecording.$);
1111

12-
if (commit === null || isRecording) {
12+
if (commit === null || !commit.rendered.length || isRecording) {
1313
return null;
1414
}
1515

16-
const root = commit.nodes.get(commit.commitRootId)!;
17-
if (!root) {
18-
return null;
19-
}
16+
const startTime = commit.nodes.get(commit.rendered[0])?.startTime || 0;
2017

2118
return (
2219
<SidebarPanel title="Commit Stats">
2320
<dl class={s.list}>
2421
<dt class={s.title}>Start:</dt>
25-
<dd class={s.value}>{formatTime(root.startTime)}</dd>
22+
<dd class={s.value}>{formatTime(startTime)}</dd>
2623
<br />
2724
<dt class={s.title}>Duration:</dt>
2825
<dd class={s.value}>{formatTime(commit.duration)} </dd>

0 commit comments

Comments
 (0)