File tree 1 file changed +6
-3
lines changed
1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -32,6 +32,11 @@ const CertificationModal = ({
32
32
const [ hasExpiryDate , setHasExpiryDate ] = useState < boolean > (
33
33
editMode && ! ! userCertificationRef . to
34
34
) ;
35
+ const sortedCerts = certificationsRef
36
+ ? certificationsRef . sort ( ( a , b ) =>
37
+ a . certBody + a . name > b . certBody + b . name ? 1 : - 1
38
+ )
39
+ : [ ] ;
35
40
36
41
return (
37
42
< div className = "flex flex-col max-h-75vh p-2 w-full" >
@@ -77,9 +82,7 @@ const CertificationModal = ({
77
82
< CustomSelect
78
83
labelFn = { ( cert ) => `${ cert ?. certBody } - ${ cert ?. name } ` }
79
84
keyFn = { ( cert ) => cert . id }
80
- choices = { certificationsRef . sort ( ( a , b ) =>
81
- a . certBody + a . name > b . certBody + b . name ? 1 : - 1
82
- ) }
85
+ choices = { sortedCerts }
83
86
selectedChoice = { userCertification ?. Certification }
84
87
placeholder = { t ( "userProfile.certModal.selectCert" ) }
85
88
readOnly = { editMode }
You can’t perform that action at this time.
0 commit comments