Skip to content

Commit a7d9a22

Browse files
fix: 修复 main 文件及 "production" 的问题
1 parent dab0783 commit a7d9a22

8 files changed

Lines changed: 6804 additions & 6413 deletions

File tree

src/components/AutoUpdater.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ export function AutoUpdater({
6868
}
6969

7070
if (
71-
"production" === 'test' ||
72-
"production" === 'development'
71+
process.env.NODE_ENV === 'test' ||
72+
process.env.NODE_ENV === 'development'
7373
) {
7474
logForDebugging(
7575
'AutoUpdater: Skipping update check in test/dev environment',

src/components/DevBar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { Text, useInterval } from '../ink.js'
66
// Show DevBar for dev builds or all ants
77
function shouldShowDevBar(): boolean {
88
return (
9-
"production" === 'development' || process.env.USER_TYPE === 'ant'
9+
process.env.NODE_ENV === 'development' || process.env.USER_TYPE === 'ant'
1010
)
1111
}
1212

src/components/NativeAutoUpdater.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@ export function NativeAutoUpdater({
8383
}
8484

8585
if (
86-
"production" === 'test' ||
87-
"production" === 'development'
86+
process.env.NODE_ENV === 'test' ||
87+
process.env.NODE_ENV === 'development'
8888
) {
8989
logForDebugging(
9090
'NativeAutoUpdater: Skipping update check in test/dev environment',

src/components/PackageManagerAutoUpdater.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ export function PackageManagerAutoUpdater({ verbose }: Props): React.ReactNode {
3333

3434
const checkForUpdates = React.useCallback(async () => {
3535
if (
36-
"production" === 'test' ||
37-
"production" === 'development'
36+
process.env.NODE_ENV === 'test' ||
37+
process.env.NODE_ENV === 'development'
3838
) {
3939
return
4040
}

src/hooks/useTypeahead.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -623,7 +623,7 @@ export function useTypeahead({
623623
// subsequent tests in the shard. The subscriber still registers so
624624
// fileSuggestions tests that trigger a refresh directly work correctly.
625625
useEffect(() => {
626-
if ("production" !== 'test') {
626+
if (process.env.NODE_ENV !== 'test') {
627627
startBackgroundCacheRefresh()
628628
}
629629
return onIndexBuildComplete(() => {

src/interactiveHelpers.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ export async function showSetupScreens(
153153
devChannels?: ChannelEntry[],
154154
): Promise<boolean> {
155155
if (
156-
"production" === 'test' ||
156+
process.env.NODE_ENV === 'test' ||
157157
isEnvTruthy(false) ||
158158
process.env.IS_DEMO // Skip onboarding in demo mode
159159
) {

0 commit comments

Comments
 (0)