Skip to content

Commit 1e53943

Browse files
author
HitMargin
committed
修复小问题
1 parent a0141c1 commit 1e53943

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/components/ConsoleOAuthFlow.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ export function ConsoleOAuthFlow({
119119
const timer = setTimeout(setOAuthStatus, 1000, oauthStatus.nextState)
120120
return () => clearTimeout(timer)
121121
}
122-
}, [oauthStatus.state, oauthStatus.nextState])
122+
}, [oauthStatus])
123123

124124
// Handle Enter to continue on success state
125125
useKeybinding(
@@ -178,7 +178,7 @@ export function ConsoleOAuthFlow({
178178
})
179179
setPastedCode('')
180180
}
181-
}, [pastedCode, oauthStatus.state, oauthStatus.url, showPastePrompt, urlCopied])
181+
}, [pastedCode, oauthStatus, showPastePrompt, urlCopied])
182182

183183
async function handleSubmitCode(value: string, url: string) {
184184
try {
@@ -648,7 +648,7 @@ function OAuthStatusMessage({
648648
for (const [k, v] of Object.entries(env)) process.env[k] = v
649649
setOAuthStatus({ state: 'success' })
650650
// Schedule onDone after state update to avoid potential state update on unmounted component
651-
setTimeout(onDone, 0)
651+
void onDone()
652652
}
653653
}, [activeField, inputValue, displayValues, setOAuthStatus, onDone])
654654

@@ -845,7 +845,7 @@ function OAuthStatusMessage({
845845
for (const [k, v] of Object.entries(env)) process.env[k] = v
846846
setOAuthStatus({ state: 'success' })
847847
// Schedule onDone after state update to avoid potential state update on unmounted component
848-
setTimeout(onDone, 0)
848+
void onDone()
849849
}
850850
}, [activeField, openaiInputValue, openaiDisplayValues, setOAuthStatus, onDone])
851851

0 commit comments

Comments
 (0)