bugfix: delay calc

This commit is contained in:
cv
2021-05-06 12:35:17 +02:00
parent f3924d4beb
commit 50e2fd5695
2 changed files with 6 additions and 3 deletions
@@ -15,7 +15,8 @@ const areEqual = (prevProps, nextProps) => {
prevProps.data.revision === nextProps.data.revision &&
prevProps.selected === nextProps.selected &&
prevProps.next === nextProps.next &&
prevProps.index === nextProps.index
prevProps.index === nextProps.index &&
prevProps.delay === nextProps.delay
);
};
@@ -128,8 +128,10 @@ export default function EventList(props) {
ref={provided.innerRef}
>
{events.map((e, index) => {
if (e.type === 'delay') cumulativeDelay += e.duration;
else if (e.type === 'block') cumulativeDelay = 0;
if (index === 0) cumulativeDelay = 0;
if (e.type === 'delay' && e.duration != null) {
cumulativeDelay += e.duration;
} else if (e.type === 'block') cumulativeDelay = 0;
return (
<Fragment key={e.id}>
<EventListItem