Skip to content

Commit

Permalink
Misc "?." for safety
Browse files Browse the repository at this point in the history
  • Loading branch information
Vadorequest committed Jun 4, 2020
1 parent d77473b commit 888db8e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ export function reportWebVitals(metrics: NextWebVitalsMetrics): void {
const { name } = metrics;
const count = globalWebVitalsMetric.reportedCount;
globalWebVitalsMetric.metrics[name] = metrics;
const keysLength = Object.keys(globalWebVitalsMetric.metrics).length;
const keysLength = Object.keys(globalWebVitalsMetric.metrics)?.length;

// Temporise analytics API calls by waiting for at least 5 metrics to be received before sending the first report
// (because 3 metrics will be received upon initial page load, and then 2 more upon first click)
Expand Down

0 comments on commit 888db8e

Please sign in to comment.