@@ -37,7 +37,7 @@ type TProps = {
37
37
code : accountApi . AccountCode ;
38
38
} ;
39
39
40
- type AddressDialog = { addressType : number } | undefined ;
40
+ type AddressTypeDialog = { addressType : number } | undefined ;
41
41
42
42
// For BTC/LTC: all possible address types we want to offer to the user, ordered by priority (first one is default).
43
43
// Types that are not available in the addresses delivered by the backend should be ignored.
@@ -63,7 +63,7 @@ export const Receive = ({
63
63
const [ activeIndex , setActiveIndex ] = useState < number > ( 0 ) ;
64
64
// index into `availableScriptTypes`, or 0 if none are available.
65
65
const [ addressType , setAddressType ] = useState < number > ( 0 ) ;
66
- const [ addressDialog , setAddressDialog ] = useState < AddressDialog > ( ) ;
66
+ const [ addressTypeDialog , setAddressTypeDialog ] = useState < AddressTypeDialog > ( ) ;
67
67
const [ currentAddresses , setCurrentAddresses ] = useState < accountApi . IReceiveAddress [ ] > ( ) ;
68
68
const [ currentAddressIndex , setCurrentAddressIndex ] = useState < number > ( 0 ) ;
69
69
@@ -76,9 +76,9 @@ export const Receive = ({
76
76
const availableScriptTypes = useRef < accountApi . ScriptType [ ] > ( ) ;
77
77
78
78
const hasManyScriptTypes = availableScriptTypes . current && availableScriptTypes . current . length > 1 ;
79
- const scriptTypeDialogOpened = ! ! ( addressDialog && ( hasManyScriptTypes || insured ) ) ;
79
+ const addressTypeDialogOpened = ! ! ( addressTypeDialog && ( hasManyScriptTypes || insured ) ) ;
80
80
81
- useEsc ( ( ) => ! scriptTypeDialogOpened && ! verifying && route ( `/account/${ code } ` ) ) ;
81
+ useEsc ( ( ) => ! addressTypeDialogOpened && ! verifying && route ( `/account/${ code } ` ) ) ;
82
82
83
83
useEffect ( ( ) => {
84
84
if ( receiveAddresses ) {
@@ -99,11 +99,11 @@ export const Receive = ({
99
99
} , [ addressType , availableScriptTypes , receiveAddresses ] ) ;
100
100
101
101
const handleSubmit = ( e : React . FormEvent < HTMLFormElement > ) => {
102
- if ( addressDialog ) {
102
+ if ( addressTypeDialog ) {
103
103
e . preventDefault ( ) ;
104
104
setActiveIndex ( 0 ) ;
105
- setAddressType ( addressDialog . addressType ) ;
106
- setAddressDialog ( undefined ) ;
105
+ setAddressType ( addressTypeDialog . addressType ) ;
106
+ setAddressTypeDialog ( undefined ) ;
107
107
}
108
108
} ;
109
109
@@ -206,25 +206,25 @@ export const Receive = ({
206
206
{ ( hasManyScriptTypes || insured ) && (
207
207
< button
208
208
className = { style . changeType }
209
- onClick = { ( ) => setAddressDialog ( ! addressDialog ? { addressType } : undefined ) } >
209
+ onClick = { ( ) => setAddressTypeDialog ( ! addressTypeDialog ? { addressType } : undefined ) } >
210
210
{ t ( 'receive.changeScriptType' ) }
211
211
</ button >
212
212
) }
213
213
< form onSubmit = { handleSubmit } >
214
- < Dialog open = { scriptTypeDialogOpened } onClose = { ( ) => setAddressDialog ( undefined ) } medium title = { t ( 'receive.changeScriptType' ) } >
214
+ < Dialog open = { addressTypeDialogOpened } onClose = { ( ) => setAddressTypeDialog ( undefined ) } medium title = { t ( 'receive.changeScriptType' ) } >
215
215
{ availableScriptTypes . current && availableScriptTypes . current . map ( ( scriptType , i ) => (
216
216
< div key = { scriptType } >
217
- { addressDialog && (
217
+ { addressTypeDialog && (
218
218
< >
219
219
< Radio
220
- checked = { addressDialog . addressType === i }
220
+ checked = { addressTypeDialog . addressType === i }
221
221
id = { scriptType }
222
222
name = "scriptType"
223
- onChange = { ( ) => setAddressDialog ( { addressType : i } ) }
223
+ onChange = { ( ) => setAddressTypeDialog ( { addressType : i } ) }
224
224
title = { getScriptName ( scriptType ) } >
225
225
{ t ( `receive.scriptType.${ scriptType } ` ) }
226
226
</ Radio >
227
- { scriptType === 'p2tr' && addressDialog . addressType === i && (
227
+ { scriptType === 'p2tr' && addressTypeDialog . addressType === i && (
228
228
< Message type = "warning" >
229
229
{ t ( 'receive.taprootWarning' ) }
230
230
</ Message >
0 commit comments