fix: reinstate gui telemetry for non-continue users by separating sentry and posthog logic
This commit is contained in:
parent
505c9d8b92
commit
ced972d1ea
1 changed files with 8 additions and 4 deletions
|
|
@ -29,7 +29,8 @@ const TelemetryProviders = ({ children }: PropsWithChildren) => {
|
|||
);
|
||||
|
||||
useEffect(() => {
|
||||
if (allowAnonymousTelemetry && hasContinueEmail) {
|
||||
// PostHog depends only on allowAnonymousTelemetry
|
||||
if (allowAnonymousTelemetry) {
|
||||
// Initialize PostHog (existing logic)
|
||||
posthog.init("phc_JS6XFROuNbhJtVCEdTSYk6gl5ArRrTNMpCcguAXlSPs", {
|
||||
api_host: "https://app.posthog.com",
|
||||
|
|
@ -41,7 +42,13 @@ const TelemetryProviders = ({ children }: PropsWithChildren) => {
|
|||
});
|
||||
posthog.identify(window.vscMachineId);
|
||||
posthog.opt_in_capturing();
|
||||
} else {
|
||||
// Disable PostHog
|
||||
posthog.opt_out_capturing();
|
||||
}
|
||||
|
||||
// Sentry depends on both allowAnonymousTelemetry and hasContinueEmail
|
||||
if (allowAnonymousTelemetry && hasContinueEmail) {
|
||||
// Initialize Sentry (new for GUI - enhanced React setup)
|
||||
Sentry.init({
|
||||
dsn: SENTRY_DSN,
|
||||
|
|
@ -95,9 +102,6 @@ const TelemetryProviders = ({ children }: PropsWithChildren) => {
|
|||
});
|
||||
Sentry.setUser(anonymizedUser);
|
||||
} else {
|
||||
// Disable PostHog
|
||||
posthog.opt_out_capturing();
|
||||
|
||||
// Disable Sentry properly - close the client to stop all network requests
|
||||
try {
|
||||
const client = Sentry.getClient();
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue