Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Philip Walton <philipwalton@users.noreply.github.com>
  • Loading branch information
rviscomi and philipwalton committed Jan 23, 2024
1 parent 0b15967 commit ef24da1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/attribution/onINP.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ const attributeINP = (metric: INPMetric): void => {
// for all events in the same interaction, we pick the first non-null one.
// TODO: remove when 1367329 is resolved
// https://bugs.chromium.org/p/chromium/issues/detail?id=1367329
const firstTargetEntry = metric.entries.find((entry) => entry.target);
const firstEntryWithTarget = metric.entries.find((entry) => entry.target);

(metric as INPMetricWithAttribution).attribution = {
eventTarget: getSelector(firstTargetEntry?.target),
eventTarget: getSelector(firstEntryWithTarget && firstEntryWithTarget.target),
eventType: longestEntry.name,
eventTime: longestEntry.startTime,
eventEntry: longestEntry,
Expand Down

0 comments on commit ef24da1

Please sign in to comment.