Skip to content

Commit 0c84f1e

Browse files
committed
add log
1 parent ab414b4 commit 0c84f1e

3 files changed

Lines changed: 21 additions & 2 deletions

File tree

packages/shared/src/components/modals/IntroQuestModal.spec.tsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,11 @@ describe('IntroQuestModal', () => {
218218
title: 'Yes, hide it',
219219
},
220220
});
221+
expect(logEvent).toHaveBeenCalledWith({
222+
event_name: LogEvent.Click,
223+
target_type: TargetType.IntroQuestModal,
224+
target_id: 'hide',
225+
});
221226
expect(completeAction).toHaveBeenCalledWith(
222227
ActionType.IntroQuestsCompleted,
223228
);
@@ -244,6 +249,11 @@ describe('IntroQuestModal', () => {
244249
}),
245250
);
246251

252+
expect(logEvent).toHaveBeenCalledWith({
253+
event_name: LogEvent.Click,
254+
target_type: TargetType.IntroQuestModal,
255+
target_id: 'hide',
256+
});
247257
expect(completeAction).toHaveBeenCalledTimes(1);
248258
expect(completeAction).toHaveBeenCalledWith(ActionType.ViewedIntroQuests);
249259
expect(onRequestClose).not.toHaveBeenCalled();

packages/shared/src/components/modals/IntroQuestModal.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,12 @@ export const IntroQuestModal = ({
309309
);
310310

311311
const handleHideIntroQuests = useCallback(async (): Promise<void> => {
312+
logEvent({
313+
event_name: LogEvent.Click,
314+
target_type: TargetType.IntroQuestModal,
315+
target_id: 'hide',
316+
});
317+
312318
const shouldHide = await showPrompt({
313319
title: 'Hide intro quests?',
314320
description:
@@ -324,7 +330,7 @@ export const IntroQuestModal = ({
324330

325331
await completeAction(ActionType.IntroQuestsCompleted);
326332
onRequestClose?.(undefined as never);
327-
}, [completeAction, onRequestClose, showPrompt]);
333+
}, [completeAction, logEvent, onRequestClose, showPrompt]);
328334

329335
useEffect(() => {
330336
return () => {

packages/shared/src/lib/featureManagement.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,10 @@ export const featureProfileCompletionIndicator = new Feature(
145145
0,
146146
);
147147

148-
export const featureNewD1Experience = new Feature('new_d1_experience', true);
148+
export const featureNewD1Experience = new Feature(
149+
'new_d1_experience',
150+
isDevelopment,
151+
);
149152

150153
export const questsFeature = new Feature('quests', true);
151154

0 commit comments

Comments
 (0)