Replace NODE_ENV in places where its safe
This commit is contained in:
+1
-1
@@ -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
|
||||
|
||||
@@ -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
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user