Skip to content

Commit 6874efa

Browse files
Type fixes
1 parent d672df2 commit 6874efa

1 file changed

Lines changed: 13 additions & 6 deletions

File tree

src/lib/components/lines-and-dots/svg/timeline-graph.svelte

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,18 @@
4646
const filteredGroups = $derived(
4747
getFailedOrPendingGroups(groups, $eventStatusFilter),
4848
);
49-
const firstStartTime = $derived(
50-
$fullEventHistory[0]?.eventTime < workflow.executionTime
51-
? $fullEventHistory[0]?.eventTime
52-
: workflow.executionTime,
53-
);
49+
const firstStartTime = $derived.by(() => {
50+
const firstEventTime = $fullEventHistory[0]?.eventTime;
51+
52+
if (!firstEventTime) {
53+
return workflow.executionTime;
54+
}
55+
56+
return firstEventTime < workflow.executionTime
57+
? firstEventTime
58+
: workflow.executionTime;
59+
});
60+
5461
const startTime = $derived(
5562
(!isWorkflowDelayed(workflow) && firstStartTime) || workflow.startTime,
5663
);
@@ -127,7 +134,7 @@
127134
x2={canvasWidth - gutter + radius / 4}
128135
{timelineHeight}
129136
{startTime}
130-
{duration}
137+
duration={duration ?? 0}
131138
/>
132139
<WorkflowRow {workflow} y={height} length={canvasWidth} />
133140
{#each filteredGroups as group, index (group.id)}

0 commit comments

Comments
 (0)