@@ -24,17 +24,18 @@ export function NewDocDialog({
2424 ( ) =>
2525 createRandom (
2626 Math . ceil (
27- passwordGenerators . reduce ( ( maxNeeded , { entropyNeeded } ) => Math . max ( maxNeeded , entropyNeeded ) , 0 ) / 8
28- )
27+ passwordGenerators . reduce (
28+ ( maxNeeded , { entropyNeeded } ) =>
29+ Math . max ( maxNeeded , entropyNeeded ) ,
30+ 0 ,
31+ ) / 8 ,
32+ ) ,
2933 ) ,
3034 [ lastRefresh ] ,
3135 ) ;
32- const passwordGenerator = useMemo (
33- ( ) => {
34- return passwordGenerators [ idType ]
35- } ,
36- [ idType ] ,
37- ) ;
36+ const passwordGenerator = useMemo ( ( ) => {
37+ return passwordGenerators [ idType ] ;
38+ } , [ idType ] ) ;
3839 const password = useMemo (
3940 ( ) => passwordGenerator . getRandom ( random ( ) ) ,
4041 [ random , passwordGenerator ] ,
@@ -51,7 +52,10 @@ export function NewDocDialog({
5152 onChange = { ( e ) => {
5253 const typeForm = e . currentTarget . elements ;
5354 setIdType (
54- parseInt ( ( typeForm [ "idType" as any ] as any as RadioNodeList ) . value , 10 ) ,
55+ parseInt (
56+ ( typeForm [ "idType" as any ] as any as RadioNodeList ) . value ,
57+ 10 ,
58+ ) ,
5559 ) ;
5660 setType (
5761 types . find ( ( type ) => {
@@ -108,18 +112,16 @@ export function NewDocDialog({
108112 enter. Choose as you like.
109113 </ p >
110114 < div style = { { display : "flex" , flexDirection : "column" } } >
111- {
112- passwordGenerators . map ( ( { humanName } , num ) =>
113- < InputWithLabel
114- type = "radio"
115- name = "idType"
116- key = { num }
117- value = { num }
118- label = { humanName }
119- defaultChecked = { num === 0 }
120- />
121- )
122- }
115+ { passwordGenerators . map ( ( { humanName } , num ) => (
116+ < InputWithLabel
117+ type = "radio"
118+ name = "idType"
119+ key = { num }
120+ value = { num }
121+ label = { humanName }
122+ defaultChecked = { num === 0 }
123+ />
124+ ) ) }
123125 </ div >
124126 < InputWithLabel
125127 type = "text"
0 commit comments