fix(useFunnelMetrics): ensure latency type defaults to P99 when undefined

This commit is contained in:
ahmadshaheer 2025-06-02 12:59:55 +04:30
parent af54aa4632
commit 6309ff96bd

View File

@ -91,7 +91,10 @@ export function useFunnelStepsMetrics({
} = useFunnelStepsOverview(funnelId, payload); } = useFunnelStepsOverview(funnelId, payload);
const latencyType = useMemo( const latencyType = useMemo(
() => (stepStart ? steps[stepStart]?.latency_type : LatencyOptions.P99), () =>
stepStart
? steps[stepStart]?.latency_type ?? LatencyOptions.P99
: LatencyOptions.P99,
[stepStart, steps], [stepStart, steps],
); );
@ -113,7 +116,7 @@ export function useFunnelStepsMetrics({
), ),
}, },
{ {
title: `${latencyType?.toUpperCase()} Latency`, title: `${latencyType.toUpperCase()} Latency`,
value: getYAxisFormattedValue( value: getYAxisFormattedValue(
(sourceData.latency * 1_000_000).toString(), (sourceData.latency * 1_000_000).toString(),
'ns', 'ns',