fix: close github authorization window (#29617)

This commit is contained in:
Alaister Young authored and GitHub committed 2024-10-03 18:43:31 +08:00
1 parent 47d2ab8976
commit cca2b8fba3
1 file changed
+4 -2
@@ -4,7 +4,7 @@ import { useParams } from 'common'
import { useGitHubAuthorizationCreateMutation } from 'data/integrations/github-authorization-create-mutation'
const GitHubIntegrationAuthorize = () => {
const { code, state } = useParams()
const { code, state, setup_action } = useParams()
const { mutate, isSuccess, isError, isLoading } = useGitHubAuthorizationCreateMutation({
onSuccess() {
@@ -15,8 +15,10 @@ const GitHubIntegrationAuthorize = () => {
useEffect(() => {
if (code && state) {
mutate({ code, state })
} else if (setup_action === 'install') {
window.close()
}
}, [code, state, mutate])
}, [code, state, mutate, setup_action])
return (
<div className="h-screen flex flex-col justify-center items-center gap-4">