Skip to content

Commit

Permalink
chore: Analytics - embedding mode selection event only tracks open ev…
Browse files Browse the repository at this point in the history
…ent (#1000)
  • Loading branch information
tihuan authored Jun 20, 2024
1 parent c53322c commit 7dcee26
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion client/src/components/embedding/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ const Embedding = (props: Props) => {

const isSpatial = getFeatureFlag(FEATURES.SPATIAL);

/**
* (thuang): Attach to `onOpening` event to only track the event when the user
* clicks on the dropdown to open the popover, not when the popover is closed.
*/
const handleLayoutChoiceClick = (): void => {
track(
isSidePanel
Expand Down Expand Up @@ -115,6 +119,7 @@ const Embedding = (props: Props) => {
<ButtonGroup>
<Popover2
// minimal /* removes arrow */
onOpening={handleLayoutChoiceClick}
position={Position.TOP_LEFT}
content={
<div
Expand Down Expand Up @@ -156,7 +161,6 @@ const Embedding = (props: Props) => {
}}
icon={IconNames.GRAPH}
rightIcon={IconNames.CARET_DOWN}
onClick={handleLayoutChoiceClick}
>
{layoutChoice?.current}
</Button>
Expand Down

0 comments on commit 7dcee26

Please sign in to comment.