Skip to content

Commit

Permalink
Stats: Remove redundant shortcut click event for gated WPCOM sites (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
dognose24 authored Dec 17, 2024
1 parent 6b9d967 commit 51efc2b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion client/components/stats-date-control/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,6 @@ const StatsDateControl = ( {
// handler for shortcut clicks
const onShortcutClickHandler = ( shortcut: DateRangePickerShortcut ) => {
const event_from = isOdysseyStats ? 'jetpack_odyssey' : 'calypso';
recordTracksEvent( eventNames[ event_from ][ shortcut.id as EventNameKey ] );

if ( shortcut.isGated ) {
onGatedHandler &&
Expand All @@ -175,6 +174,8 @@ const StatsDateControl = ( {
event_from,
shortcut.statType ?? shortcut.id
);
} else {
recordTracksEvent( eventNames[ event_from ][ shortcut.id as EventNameKey ] );
}
};

Expand Down

0 comments on commit 51efc2b

Please sign in to comment.