Replace NODE_ENV in places where its safe

This commit is contained in:
Eric Bailey
2025-07-22 18:46:09 -05:00
parent d0ea968022
commit 70fa7a1a20
3 changed files with 5 additions and 3 deletions
+1 -1
View File
@@ -3,7 +3,7 @@ import {type Did} from '@atproto/api'
/**
* The env the app is running in e.g. development, testflight, production
*/
export const ENV = process.env.EXPO_PUBLIC_ENV
export const ENV: string = process.env.EXPO_PUBLIC_ENV
/**
* Indicates whether the app is running in TestFlight
+2 -1
View File
@@ -8,6 +8,7 @@ import {logger} from '#/logger'
import {type MetricEvents} from '#/logger/metrics'
import {isWeb} from '#/platform/detection'
import * as persisted from '#/state/persisted'
import {ENV} from '#/env'
import {useSession} from '../../state/session'
import {timeout} from '../async/timeout'
import {useNonReactiveCallback} from '../hooks/useNonReactiveCallback'
@@ -48,7 +49,7 @@ function createStatsigOptions(prefetchUsers: StatsigUser[]) {
return {
environment: {
tier:
process.env.NODE_ENV === 'development'
ENV === 'development'
? 'development'
: IS_TESTFLIGHT
? 'staging'
+2 -1
View File
@@ -14,9 +14,10 @@ import {
} from '#/logger/types'
import {enabledLogLevels} from '#/logger/util'
import {isNative} from '#/platform/detection'
import {ENV} from '#/env'
const TRANSPORTS: Transport[] = (function configureTransports() {
switch (process.env.NODE_ENV) {
switch (ENV) {
case 'production': {
return [sentryTransport, isNative && bitdriftTransport].filter(
Boolean,