Minor fixes to journey stats (#208)

This commit is contained in:
Chris Anderson 2023-06-27 10:06:04 -05:00 committed by GitHub
parent 928b83802b
commit 22bd7d8fbf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View file

@ -274,7 +274,7 @@ export const getJourneyStepStats = async (journeyId: number) => {

return steps.reduce<JourneyStepStats>((a, { external_id, id }) => {
a[external_id] = {
completions: completions.find(uc => uc.step_id)?.users ?? 0,
completions: completions.find(uc => uc.step_id === id)?.users ?? 0,
waiting: waiting.find(uc => uc.step_id === id)?.users ?? 0,
}
return a

View file

@ -111,8 +111,8 @@ function JourneyStepNode({
</span>
<h4 className="step-header-title">{type.name}</h4>
<div className="step-header-stats">
<span className="stat">{stats.waiting}<TimeIcon /></span>
<span className="stat">{stats.completions}<CheckCircleIcon /></span>
{typeName === 'delay' && <span className="stat">{(stats?.waiting ?? 0).toLocaleString()}<TimeIcon /></span>}
<span className="stat">{(stats?.completions ?? 0).toLocaleString()}<CheckCircleIcon /></span>
</div>
</div>
{