File tree Expand file tree Collapse file tree 2 files changed +20
-20
lines changed
compass-indexes/src/components/create-index-modal Expand file tree Collapse file tree 2 files changed +20
-20
lines changed Original file line number Diff line number Diff line change @@ -80,17 +80,10 @@ function CreateIndexModal({
8080 'showIndexesGuidanceVariant'
8181 ) ;
8282
83- useTrackOnChange (
84- ( track : TrackFunction ) => {
85- fireExperimentViewed ( {
86- track,
87- testName : TestName . earlyJourneyIndexesGuidance ,
88- shouldFire : enableInIndexesGuidanceExp ,
89- } ) ;
90- } ,
91- [ enableInIndexesGuidanceExp ] ,
92- undefined
93- ) ;
83+ fireExperimentViewed ( {
84+ testName : TestName . earlyJourneyIndexesGuidance ,
85+ shouldFire : enableInIndexesGuidanceExp || true ,
86+ } ) ;
9487
9588 return (
9689 < Modal
Original file line number Diff line number Diff line change 1- import { type TrackFunction } from '@mongodb-js/compass-telemetry/provider' ;
1+ import {
2+ useTrackOnChange ,
3+ type TrackFunction ,
4+ } from '@mongodb-js/compass-telemetry/provider' ;
25
36export enum TestName {
47 earlyJourneyIndexesGuidance = 'EARLY_JOURNEY_INDEXES_GUIDANCE_20250328' ,
58}
69
710export const fireExperimentViewed = ( {
8- track,
911 testName,
1012 shouldFire = true ,
1113} : {
12- track : TrackFunction ;
1314 testName : TestName ;
1415 shouldFire ?: boolean ;
1516} ) => {
16- if ( ! shouldFire ) {
17- return ;
18- }
19- track ( 'Experiment Viewed' , {
20- test_name : testName ,
21- } ) ;
17+ useTrackOnChange (
18+ ( track : TrackFunction ) => {
19+ if ( ! shouldFire ) {
20+ return ;
21+ }
22+ track ( 'Experiment Viewed' , {
23+ test_name : testName ,
24+ } ) ;
25+ } ,
26+ [ ] ,
27+ undefined
28+ ) ;
2229} ;
You can’t perform that action at this time.
0 commit comments