fix visitDuration calculation and conditionally show bounce/visitDuration on session columns

This commit is contained in:
Francis Cao
2025-08-25 09:26:49 -07:00
parent 6c832bd0db
commit f06ef6fbc9
4 changed files with 28 additions and 106 deletions

View File

@@ -59,7 +59,7 @@ export function Breakdown({ websiteId, selectedFields = [], startDate, endDate }
</DataColumn>
<DataColumn id="visitDuration" label={formatMessage(labels.visitDuration)} align="end">
{row => {
const n = (row?.['totaltime'] / row?.['visits']) * 100;
const n = row?.['totaltime'] / row?.['visits'];
return `${+n < 0 ? '-' : ''}${formatShortTime(Math.abs(~~n), ['m', 's'], ' ')}`;
}}
</DataColumn>