From 117294066dfad9ef3f2220ca05ebaecafdf03a72 Mon Sep 17 00:00:00 2001 From: Marvin Hagemeister Date: Tue, 17 May 2022 20:58:31 +0200 Subject: [PATCH] Remove commitRootId from RenderedAt --- .../components/RenderedAt/RenderedAt.tsx | 28 ++++++++----------- 1 file changed, 11 insertions(+), 17 deletions(-) diff --git a/src/view/components/profiler/components/RenderedAt/RenderedAt.tsx b/src/view/components/profiler/components/RenderedAt/RenderedAt.tsx index d0a9fb99..0f26ad50 100644 --- a/src/view/components/profiler/components/RenderedAt/RenderedAt.tsx +++ b/src/view/components/profiler/components/RenderedAt/RenderedAt.tsx @@ -9,24 +9,18 @@ export function RenderedAt() { const data = useObserver(() => { const id = store.profiler.selectedNodeId.$; - return store.profiler.commits.$.filter(x => { - if (x.nodes.has(id)) { - const node = x.nodes.get(id)!; - const root = x.nodes.get(x.commitRootId)!; - return node.startTime >= root.startTime && node.endTime <= root.endTime; - } + return store.profiler.commits.$.filter(x => x.rendered.includes(id)).map( + commit => { + const node = commit.nodes.get(id)!; - return false; - }).map(commit => { - const node = commit.nodes.get(id)!; - - const selfDuration = commit.selfDurations.get(id) || 0; - return { - index: store.profiler.commits.$.findIndex(x => x === commit), - startTime: node.startTime, - selfDuration, - }; - }); + const selfDuration = commit.selfDurations.get(id) || 0; + return { + index: store.profiler.commits.$.findIndex(x => x === commit), + startTime: node.startTime, + selfDuration, + }; + }, + ); }); const commitIdx = useObserver(() => store.profiler.activeCommitIdx.$);