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
|
* 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
|
* Indicates whether the app is running in TestFlight
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import {logger} from '#/logger'
|
|||||||
import {type MetricEvents} from '#/logger/metrics'
|
import {type MetricEvents} from '#/logger/metrics'
|
||||||
import {isWeb} from '#/platform/detection'
|
import {isWeb} from '#/platform/detection'
|
||||||
import * as persisted from '#/state/persisted'
|
import * as persisted from '#/state/persisted'
|
||||||
|
import {ENV} from '#/env'
|
||||||
import {useSession} from '../../state/session'
|
import {useSession} from '../../state/session'
|
||||||
import {timeout} from '../async/timeout'
|
import {timeout} from '../async/timeout'
|
||||||
import {useNonReactiveCallback} from '../hooks/useNonReactiveCallback'
|
import {useNonReactiveCallback} from '../hooks/useNonReactiveCallback'
|
||||||
@@ -48,7 +49,7 @@ function createStatsigOptions(prefetchUsers: StatsigUser[]) {
|
|||||||
return {
|
return {
|
||||||
environment: {
|
environment: {
|
||||||
tier:
|
tier:
|
||||||
process.env.NODE_ENV === 'development'
|
ENV === 'development'
|
||||||
? 'development'
|
? 'development'
|
||||||
: IS_TESTFLIGHT
|
: IS_TESTFLIGHT
|
||||||
? 'staging'
|
? 'staging'
|
||||||
|
|||||||
+2
-1
@@ -14,9 +14,10 @@ import {
|
|||||||
} from '#/logger/types'
|
} from '#/logger/types'
|
||||||
import {enabledLogLevels} from '#/logger/util'
|
import {enabledLogLevels} from '#/logger/util'
|
||||||
import {isNative} from '#/platform/detection'
|
import {isNative} from '#/platform/detection'
|
||||||
|
import {ENV} from '#/env'
|
||||||
|
|
||||||
const TRANSPORTS: Transport[] = (function configureTransports() {
|
const TRANSPORTS: Transport[] = (function configureTransports() {
|
||||||
switch (process.env.NODE_ENV) {
|
switch (ENV) {
|
||||||
case 'production': {
|
case 'production': {
|
||||||
return [sentryTransport, isNative && bitdriftTransport].filter(
|
return [sentryTransport, isNative && bitdriftTransport].filter(
|
||||||
Boolean,
|
Boolean,
|
||||||
|
|||||||
Reference in New Issue
Block a user