diff options
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/app-info.ts | 8 | ||||
-rw-r--r-- | src/lib/app-info.web.ts | 8 | ||||
-rw-r--r-- | src/lib/hooks/useEnableKeyboardController.tsx | 4 | ||||
-rw-r--r-- | src/lib/sentry.ts | 6 |
4 files changed, 10 insertions, 16 deletions
diff --git a/src/lib/app-info.ts b/src/lib/app-info.ts index 4da70d75d..0749087ea 100644 --- a/src/lib/app-info.ts +++ b/src/lib/app-info.ts @@ -1,9 +1,7 @@ import {nativeApplicationVersion, nativeBuildVersion} from 'expo-application' -export const BUILD_ENV = process.env.EXPO_PUBLIC_ENV -export const IS_DEV = process.env.EXPO_PUBLIC_ENV === 'development' export const IS_TESTFLIGHT = process.env.EXPO_PUBLIC_ENV === 'testflight' -export const IS_INTERNAL = IS_DEV || IS_TESTFLIGHT +export const IS_INTERNAL = __DEV__ || IS_TESTFLIGHT // This is the commit hash that the current bundle was made from. The user can see the commit hash in the app's settings // along with the other version info. Useful for debugging/reporting. @@ -12,9 +10,9 @@ export const BUNDLE_IDENTIFIER = process.env.EXPO_PUBLIC_BUNDLE_IDENTIFIER ?? '' // This will always be in the format of YYMMDD, so that it always increases for each build. This should only be used // for Statsig reporting and shouldn't be used to identify a specific bundle. export const BUNDLE_DATE = - IS_TESTFLIGHT || IS_DEV ? 0 : Number(process.env.EXPO_PUBLIC_BUNDLE_DATE) + IS_TESTFLIGHT || __DEV__ ? 0 : Number(process.env.EXPO_PUBLIC_BUNDLE_DATE) export const appVersion = `${nativeApplicationVersion}.${nativeBuildVersion}` export const bundleInfo = `${BUNDLE_IDENTIFIER} (${ - IS_DEV ? 'dev' : IS_TESTFLIGHT ? 'tf' : 'prod' + __DEV__ ? 'dev' : IS_TESTFLIGHT ? 'tf' : 'prod' })` diff --git a/src/lib/app-info.web.ts b/src/lib/app-info.web.ts index 742ccfe97..94c787cbc 100644 --- a/src/lib/app-info.web.ts +++ b/src/lib/app-info.web.ts @@ -1,9 +1,7 @@ import {version} from '../../package.json' -export const BUILD_ENV = process.env.EXPO_PUBLIC_ENV -export const IS_DEV = process.env.EXPO_PUBLIC_ENV === 'development' export const IS_TESTFLIGHT = false -export const IS_INTERNAL = IS_DEV +export const IS_INTERNAL = __DEV__ // This is the commit hash that the current bundle was made from. The user can see the commit hash in the app's settings // along with the other version info. Useful for debugging/reporting. @@ -12,9 +10,9 @@ export const BUNDLE_IDENTIFIER = // This will always be in the format of YYMMDD, so that it always increases for each build. This should only be used // for Statsig reporting and shouldn't be used to identify a specific bundle. -export const BUNDLE_DATE = IS_DEV +export const BUNDLE_DATE = __DEV__ ? 0 : Number(process.env.EXPO_PUBLIC_BUNDLE_DATE) export const appVersion = version -export const bundleInfo = `${BUNDLE_IDENTIFIER} (${IS_DEV ? 'dev' : 'prod'})` +export const bundleInfo = `${BUNDLE_IDENTIFIER} (${__DEV__ ? 'dev' : 'prod'})` diff --git a/src/lib/hooks/useEnableKeyboardController.tsx b/src/lib/hooks/useEnableKeyboardController.tsx index c7205d016..366791c0c 100644 --- a/src/lib/hooks/useEnableKeyboardController.tsx +++ b/src/lib/hooks/useEnableKeyboardController.tsx @@ -12,8 +12,6 @@ import { } from 'react-native-keyboard-controller' import {useFocusEffect} from '@react-navigation/native' -import {IS_DEV} from '#/env' - const KeyboardControllerRefCountContext = createContext<{ incrementRefCount: () => void decrementRefCount: () => void @@ -57,7 +55,7 @@ function KeyboardControllerProviderInner({ refCount.current-- setEnabled(refCount.current > 0) - if (IS_DEV && refCount.current < 0) { + if (__DEV__ && refCount.current < 0) { console.error('KeyboardController ref count < 0') } }, diff --git a/src/lib/sentry.ts b/src/lib/sentry.ts index 2c390d7de..b2695694d 100644 --- a/src/lib/sentry.ts +++ b/src/lib/sentry.ts @@ -7,7 +7,7 @@ import {Platform} from 'react-native' import {nativeApplicationVersion, nativeBuildVersion} from 'expo-application' import {init} from '@sentry/react-native' -import {BUILD_ENV, IS_DEV, IS_TESTFLIGHT} from '#/lib/app-info' +import {IS_TESTFLIGHT} from '#/lib/app-info' /** * Examples: @@ -27,14 +27,14 @@ const release = nativeApplicationVersion ?? 'dev' */ const dist = `${Platform.OS}.${nativeBuildVersion}.${ IS_TESTFLIGHT ? 'tf' : '' -}${IS_DEV ? 'dev' : ''}` +}${__DEV__ ? 'dev' : ''}` init({ enabled: !__DEV__, autoSessionTracking: false, dsn: 'https://05bc3789bf994b81bd7ce20c86ccd3ae@o4505071687041024.ingest.sentry.io/4505071690514432', debug: false, // If `true`, Sentry will try to print out useful debugging information if something goes wrong with sending the event. Set it to `false` in production - environment: BUILD_ENV ?? 'development', + environment: process.env.NODE_ENV, dist, release, }) |