mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-05 07:26:34 +00:00
Fix reset env on repo change
This commit is contained in:
@@ -137,6 +137,16 @@ export default function GitHubCreateIntegrationPage() {
|
|||||||
}
|
}
|
||||||
}, [workspace]);
|
}, [workspace]);
|
||||||
|
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (integrationAuthGithubEnvs && integrationAuthGithubEnvs?.length > 0) {
|
||||||
|
setValue("envId", integrationAuthGithubEnvs[0].envId);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
setValue("envId", undefined);
|
||||||
|
}
|
||||||
|
}, [integrationAuthGithubEnvs])
|
||||||
|
|
||||||
const onFormSubmit = async (data: FormData) => {
|
const onFormSubmit = async (data: FormData) => {
|
||||||
try {
|
try {
|
||||||
setIsLoading(true);
|
setIsLoading(true);
|
||||||
@@ -422,7 +432,7 @@ export default function GitHubCreateIntegrationPage() {
|
|||||||
isError={Boolean(integrationAuthOrgs?.length && error?.message)}
|
isError={Boolean(integrationAuthOrgs?.length && error?.message)}
|
||||||
>
|
>
|
||||||
<Select
|
<Select
|
||||||
defaultValue={field.value}
|
value={field.value}
|
||||||
onValueChange={onChange}
|
onValueChange={onChange}
|
||||||
className="w-full border border-mineshaft-500"
|
className="w-full border border-mineshaft-500"
|
||||||
>
|
>
|
||||||
@@ -448,7 +458,7 @@ export default function GitHubCreateIntegrationPage() {
|
|||||||
isError={Boolean(error)}
|
isError={Boolean(error)}
|
||||||
>
|
>
|
||||||
<Select
|
<Select
|
||||||
defaultValue={field.value}
|
value={field.value}
|
||||||
onValueChange={(e) => {
|
onValueChange={(e) => {
|
||||||
setValue("repoName", e);
|
setValue("repoName", e);
|
||||||
setValue(
|
setValue(
|
||||||
@@ -495,7 +505,7 @@ export default function GitHubCreateIntegrationPage() {
|
|||||||
isError={Boolean(integrationAuthGithubEnvs?.length || error?.message)}
|
isError={Boolean(integrationAuthGithubEnvs?.length || error?.message)}
|
||||||
>
|
>
|
||||||
<Select
|
<Select
|
||||||
defaultValue={field.value}
|
value={field.value}
|
||||||
onValueChange={onChange}
|
onValueChange={onChange}
|
||||||
className="w-full border border-mineshaft-500"
|
className="w-full border border-mineshaft-500"
|
||||||
>
|
>
|
||||||
|
|||||||
Reference in New Issue
Block a user