File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed
src/components/projects/CreateProject Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff 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 ) {
You can’t perform that action at this time.
0 commit comments