Skip to content

Commit 5c9963a

Browse files
committed
fix: in react ui, timeline can show large negative durations
Signed-off-by: Nick Mitchell <[email protected]>
1 parent 2015234 commit 5c9963a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pdl-live-react/src/view/timeline/TimelineFromModel.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ export default function TimelineFromModel({ model, numbering }: Props) {
1717
const [minStart, maxEnd] = model.reduce(
1818
([minStart, maxEnd], row) => [
1919
Math.min(minStart, row.block.start_nanos),
20-
Math.max(maxEnd, row.block.end_nanos),
20+
Math.max(maxEnd, row.block.end_nanos || row.block.start_nanos),
2121
],
22-
[Number.MAX_VALUE, Number.MIN_VALUE],
22+
[Number.MAX_VALUE, -Number.MIN_VALUE],
2323
)
2424
return [minStart, maxEnd]
2525
}, [model])

0 commit comments

Comments
 (0)