Skip to content

Commit 9239e22

Browse files
authored
Better paused check (#2816)
1 parent 9083fdd commit 9239e22

1 file changed

Lines changed: 10 additions & 7 deletions

File tree

src/lib/components/event/event-summary-row.svelte

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -194,9 +194,12 @@
194194
),
195195
);
196196
197-
const hasPendingActivity = $derived(
197+
const isPendingActivity = $derived(
198198
isEventGroup(event) && event?.pendingActivity,
199199
);
200+
const isPausedPendingActivity = $derived(
201+
isPendingActivity && isPendingActivity?.paused,
202+
);
200203
201204
const pendingAttempt = $derived(
202205
isEventGroup(event) &&
@@ -347,7 +350,7 @@
347350
{#if pendingAttempt}
348351
<Badge
349352
class="mr-1"
350-
type={hasPendingActivity.paused
353+
type={isPausedPendingActivity
351354
? 'warning'
352355
: pendingAttempt > 1
353356
? 'danger'
@@ -357,17 +360,17 @@
357360
class={merge(
358361
'mr-1 inline',
359362
pendingAttempt > 1 && 'font-bold text-red-400',
360-
hasPendingActivity.paused && 'font-bold text-yellow-700',
363+
isPausedPendingActivity && 'font-bold text-yellow-700',
361364
)}
362-
name={hasPendingActivity.paused ? 'pause' : 'retry'}
365+
name={isPausedPendingActivity ? 'pause' : 'retry'}
363366
/>
364367
{translate('workflows.attempt')}
365368
{pendingAttempt}
366-
{#if hasPendingActivity}
367-
/ {hasPendingActivity.maximumAttempts || ''}
369+
{#if isPendingActivity}
370+
/ {isPendingActivity?.maximumAttempts || ''}
368371
{#if pendingAttempt > 1}
369372
{@const timeDifference = toTimeDifference({
370-
date: hasPendingActivity.scheduledTime,
373+
date: isPendingActivity?.scheduledTime,
371374
negativeDefault: '',
372375
})}
373376
{#if timeDifference}

0 commit comments

Comments
 (0)