Skip to content

Commit

Permalink
Fix variable naming and add falsey check for function
Browse files Browse the repository at this point in the history
  • Loading branch information
roryabraham committed Jun 22, 2021
1 parent 82ff7ff commit 9df65ad
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/pages/settings/AddSecondaryLoginPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,12 @@ class AddSecondaryLoginPage extends Component {

render() {
return (
<ScreenWrapper onTransitionEnd={() => this.phoneNumberInputRef.focus()}>
<ScreenWrapper onTransitionEnd={() => {
if (this.phoneNumberInputRef) {
this.phoneNumberInputRef.focus();
}
}}
>
<KeyboardAvoidingView>
<HeaderWithCloseButton
title={this.props.translate(this.formType === CONST.LOGIN_TYPE.PHONE
Expand All @@ -127,7 +132,7 @@ class AddSecondaryLoginPage extends Component {
: 'profilePage.emailAddress')}
</Text>
<TextInput
ref={e => this.phoneNumberInputRef = e}
ref={el => this.phoneNumberInputRef = el}
style={styles.textInput}
value={this.state.login}
onChangeText={login => this.setState({login})}
Expand Down

0 comments on commit 9df65ad

Please sign in to comment.