Skip to content

Commit

Permalink
chore(toolbar): Include email of users in amplitude dogfooding events (
Browse files Browse the repository at this point in the history
  • Loading branch information
ryan953 authored and roaga committed Jul 31, 2024
1 parent 0b4c69b commit 9741c8c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions static/app/utils/useDevToolbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,12 @@ import * as Sentry from '@sentry/react';
import DevToolbar from 'sentry/components/devtoolbar';
import {rawTrackAnalyticsEvent} from 'sentry/utils/analytics';
import useOrganization from 'sentry/utils/useOrganization';
import {useUser} from 'sentry/utils/useUser';

export default function useDevToolbar({enabled}: {enabled: boolean}) {
const organization = useOrganization();
const {email} = useUser();

useEffect(() => {
if (enabled) {
// TODO: this is insufficient and doesn't take into account control/silo endpoints
Expand All @@ -30,13 +33,13 @@ export default function useDevToolbar({enabled}: {enabled: boolean}) {
`https://github.com/search?q=repo%3Agetsentry%2Fsentry-options-automator+OR+repo%3Agetsentry%2Fsentry+${flag}&type=code`,

trackAnalytics: (props: {eventKey: string; eventName: string}) =>
rawTrackAnalyticsEvent({...props, organization}),
rawTrackAnalyticsEvent({...props, email, organization}),
});

return () => {
promise.then(cleanup => cleanup());
};
}
return () => {};
}, [enabled, organization]);
}, [email, enabled, organization]);
}

0 comments on commit 9741c8c

Please sign in to comment.