Skip to content

Commit

Permalink
fix: safe access navigation entry type (#290)
Browse files Browse the repository at this point in the history
* fix: safe access navigation entry type

* Remove the default to unknown per Barry
  • Loading branch information
AndersDJohnson committed Apr 13, 2023
1 parent e4460bf commit 64f1335
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib/initMetric.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export const initMetric = (name: Metric['name'], value?: number): Metric => {
navigationType = 'prerender';
} else if (document.wasDiscarded) {
navigationType = 'restore';
} else {
} else if (navEntry.type) {
navigationType = navEntry.type.replace(
/_/g,
'-'
Expand Down

0 comments on commit 64f1335

Please sign in to comment.