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 = ({
86
86
: ProductDetailFlavour . EVALUATION
87
87
) satisfies ProductDetailFlavour ;
88
88
89
- const initialValues : Values = {
90
- projectName : "" ,
91
- flavour : product ?. flavour ?? defaultFlavour ,
92
- isPrivate : isPrivateDefaultValues [ defaultPrivacy ] ,
93
- } ;
94
-
95
89
const theme = useTheme ( ) ;
96
90
const queryClient = useQueryClient ( ) ;
97
91
@@ -107,6 +101,13 @@ export const CreateProjectForm = ({
107
101
108
102
const { setCurrentProjectId } = useCurrentProjectId ( ) ;
109
103
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
+
110
111
const create = async ( values : Values , productId ?: ProductDetail [ "id" ] ) => {
111
112
try {
112
113
if ( ! productId ) {
You can’t perform that action at this time.
0 commit comments