Skip to content

Commit 89389df

Browse files
committed
fix: fix MUI warning for project flavour
1 parent a0b5f48 commit 89389df

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

src/components/projects/CreateProject/CreateProjectForm.tsx

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -86,12 +86,6 @@ export const CreateProjectForm = ({
8686
: ProductDetailFlavour.EVALUATION
8787
) satisfies ProductDetailFlavour;
8888

89-
const initialValues: Values = {
90-
projectName: "",
91-
flavour: product?.flavour ?? defaultFlavour,
92-
isPrivate: isPrivateDefaultValues[defaultPrivacy],
93-
};
94-
9589
const theme = useTheme();
9690
const queryClient = useQueryClient();
9791

@@ -107,6 +101,13 @@ export const CreateProjectForm = ({
107101

108102
const { setCurrentProjectId } = useCurrentProjectId();
109103

104+
// Calculate initial values based on data availability
105+
const initialValues: Values = {
106+
projectName: "",
107+
flavour: product?.flavour ?? (isLoading ? "" : defaultFlavour),
108+
isPrivate: isPrivateDefaultValues[defaultPrivacy],
109+
};
110+
110111
const create = async (values: Values, productId?: ProductDetail["id"]) => {
111112
try {
112113
if (!productId) {

0 commit comments

Comments
 (0)