Skip to content

Commit e4c9424

Browse files
authored
Merge pull request #184 from fbosch/fix/analytics-consent-tracking
fix(analytics): remove NODE_ENV dependency from prod gate
2 parents 66bec54 + 3d36a2c commit e4c9424

2 files changed

Lines changed: 1 addition & 5 deletions

File tree

src/lib/analytics/__tests__/trackEvent.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ describe("analytics transport wrapper", () => {
7878
NODE_ENV: "development",
7979
NEXT_PUBLIC_VERCEL_ENV: "production",
8080
}),
81-
).toBe(false);
81+
).toBe(true);
8282

8383
expect(
8484
isAnalyticsProductionEnvironment({

src/lib/analytics/trackEvent.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -393,10 +393,6 @@ export function isAnalyticsProductionEnvironment(
393393
environment: AppEnvironment = process.env,
394394
browserHostname?: string,
395395
): boolean {
396-
if (environment.NODE_ENV !== "production") {
397-
return false;
398-
}
399-
400396
if (environment.NEXT_PUBLIC_VERCEL_ENV === "production") {
401397
return true;
402398
}

0 commit comments

Comments
 (0)