Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
tunetheweb committed Apr 12, 2024
1 parent 25c29bd commit 2aff58b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/attribution/onTTFB.ts
Expand Up @@ -24,10 +24,11 @@ import {
} from '../types.js';

const attributeTTFB = (metric: TTFBMetric): void => {
// Only attribute if you have a non-zero value and a navigationEntry entry
// Only attribute if you have a non-zero responseStart value and a
// navigationEntry entry.
// E.g. For cross-origin redirects, Safari has a workerStart time but no
// TTFB time, so do not provide attribution for that.
if (metric.value && metric.entries.length) {
if (metric.entries.length && metric.entries[0].responseStart) {
const navigationEntry = metric.entries[0];
const activationStart = navigationEntry.activationStart || 0;

Expand Down

0 comments on commit 2aff58b

Please sign in to comment.