Skip to content

Commit 0b9c544

Browse files
committed
fix(create-project): restore default project privacy value when changing flavour if field is untouched
1 parent d404311 commit 0b9c544

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

components/projects/CreateProject/CreateProjectForm.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@ export const CreateProjectForm = ({
163163
handleChange,
164164
setFieldValue,
165165
values,
166+
touched,
166167
}) => (
167168
<Form style={{ marginTop: theme.spacing() }}>
168169
<FormControl
@@ -200,6 +201,8 @@ export const CreateProjectForm = ({
200201
handleChange(event);
201202
if (event.target.value === ProductDetailFlavour.EVALUATION) {
202203
void setFieldValue("isPrivate", false);
204+
} else if (!touched.isPrivate) {
205+
void setFieldValue("isPrivate", isPrivateDefaultValues[defaultPrivacy]);
203206
}
204207
}}
205208
>

0 commit comments

Comments
 (0)