Skip to content

Commit

Permalink
fix: remove un needed event
Browse files Browse the repository at this point in the history
  • Loading branch information
scopsy committed Dec 3, 2024
1 parent 494b9fb commit 2930356
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 23 deletions.
23 changes: 1 addition & 22 deletions apps/dashboard/src/hooks/use-onboarding-steps.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
import { useMemo, useEffect, useRef } from 'react';
import { useMemo } from 'react';
import { useWorkflows } from './use-workflows';
import { useOrganization } from '@clerk/clerk-react';
import { ChannelTypeEnum, IIntegration } from '@novu/shared';
import { useIntegrations } from './use-integrations';
import { useTelemetry } from './use-telemetry';
import { TelemetryEvent } from '../utils/telemetry';

export enum StepIdEnum {
ACCOUNT_CREATION = 'account-creation',
Expand Down Expand Up @@ -64,8 +62,6 @@ export function useOnboardingSteps(): OnboardingStepsResult {
const { data: workflows } = useWorkflows();
const { organization } = useOrganization();
const { integrations } = useIntegrations();
const telemetry = useTelemetry();
const previousStepsRef = useRef<Step[]>([]);

const hasInvitedTeamMember = useMemo(() => {
return (organization?.membersCount ?? 0) > 1;
Expand Down Expand Up @@ -110,23 +106,6 @@ export function useOnboardingSteps(): OnboardingStepsResult {
[workflows, hasInvitedTeamMember, providerType, integrations]
);

useEffect(() => {
const previousSteps = previousStepsRef.current;

// Track step completion changes
steps.forEach((step) => {
const previousStep = previousSteps.find((prev) => prev.id === step.id);
if (previousStep?.status !== 'completed' && step.status === 'completed') {
telemetry(TelemetryEvent.WELCOME_STEP_COMPLETED, {
stepId: step.id,
stepTitle: step.title,
});
}
});

previousStepsRef.current = steps;
}, [steps, telemetry]);

return {
steps,
providerType,
Expand Down
1 change: 0 additions & 1 deletion apps/dashboard/src/utils/telemetry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,4 @@ export enum TelemetryEvent {
WORKFLOWS_PAGE_VISIT = 'Workflows page visit',
WELCOME_PAGE_VIEWED = 'Welcome page viewed',
WELCOME_STEP_CLICKED = 'Welcome step clicked',
WELCOME_STEP_COMPLETED = 'Welcome step completed',
}

0 comments on commit 2930356

Please sign in to comment.