@@ -143,10 +143,6 @@ type Props = {
143143 wallets : Array < Wallet > ;
144144} ;
145145
146- type State = {
147- wasRecoveryPhraseValidAtLeastOnce : boolean ;
148- } ;
149-
150146interface FormFields {
151147 checkboxAcceptance1 : string ;
152148 checkboxAcceptance2 : string ;
@@ -155,19 +151,14 @@ interface FormFields {
155151}
156152
157153@observer
158- class Step1ConfigurationDialog extends Component < Props , State > {
154+ class Step1ConfigurationDialog extends Component < Props > {
159155 static contextTypes = {
160156 intl : intlShape . isRequired ,
161157 } ;
162158 static defaultProps = {
163159 error : null ,
164160 recoveryPhrase : [ ] ,
165161 } ;
166-
167- state = {
168- wasRecoveryPhraseValidAtLeastOnce : false ,
169- } ;
170-
171162 recoveryPhraseAutocomplete : Autocomplete ;
172163 form = new ReactToolboxMobxForm < FormFields > (
173164 {
@@ -187,16 +178,6 @@ class Step1ConfigurationDialog extends Component<Props, State> {
187178 this . context . intl . formatMessage ( messages . invalidRecoveryPhrase ) ,
188179 ] ,
189180 } ) ,
190- hooks : {
191- onChange : ( field ) => {
192- if (
193- this . state . wasRecoveryPhraseValidAtLeastOnce === false &&
194- field . isValid
195- ) {
196- this . setState ( { wasRecoveryPhraseValidAtLeastOnce : true } ) ;
197- }
198- } ,
199- } ,
200181 } ,
201182 walletsDropdown : {
202183 type : 'select' ,
@@ -296,15 +277,15 @@ class Step1ConfigurationDialog extends Component<Props, State> {
296277 const checkboxAcceptance1Field = form . $ ( 'checkboxAcceptance1' ) ;
297278 const checkboxAcceptance2Field = form . $ ( 'checkboxAcceptance2' ) ;
298279 const walletId = get ( wallet , 'id' , null ) ;
299- const walletsDropdownDisabled = ! (
300- recoveryPhraseField . isValid ||
301- this . state . wasRecoveryPhraseValidAtLeastOnce
302- ) ;
280+ const validRecoveryPhase = recoveryPhraseField . isValid ;
303281 const buttonClasses = classnames ( [
304282 'primary' ,
305283 isCalculatingReedemFees ? styles . isSubmitting : null ,
306284 ] ) ;
307-
285+ const walletsDropdownClasses = classnames ( [
286+ styles . walletsDropdown ,
287+ ! validRecoveryPhase ? styles . disabled : null ,
288+ ] ) ;
308289 const actions = {
309290 direction : 'column' ,
310291 items : [
@@ -389,6 +370,7 @@ class Step1ConfigurationDialog extends Component<Props, State> {
389370 />
390371 < div className = { styles . walletsDropdownWrapper } >
391372 < WalletsDropdown
373+ className = { walletsDropdownClasses }
392374 { ...walletsDropdownField . bind ( ) }
393375 numberOfStakePools = { 4 }
394376 wallets = { wallets }
@@ -399,7 +381,6 @@ class Step1ConfigurationDialog extends Component<Props, State> {
399381 value = { walletId }
400382 getStakePoolById = { ( ) => { } }
401383 errorPosition = "bottom"
402- disabled = { walletsDropdownDisabled }
403384 />
404385 </ div >
405386 < Checkbox
0 commit comments