fix topt (#75)

This commit is contained in:
Guilherme Gazzo 2017-11-13 19:51:56 -02:00 committed by GitHub
parent d8d4bee3f5
commit 8bd7459e12
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 15 additions and 15 deletions

View File

@ -62,21 +62,22 @@ class LoginView extends React.Component {
}
renderTOTP = () => {
if (this.props.login.errorMessage && this.props.login.errorMessage.error === 'totp-required') {
return (
<TextInput
ref={ref => this.codeInput = ref}
style={styles.input}
onChangeText={code => this.setState({ code })}
keyboardType='numeric'
autoCorrect={false}
returnKeyType='done'
autoCapitalize='none'
onSubmitEditing={this.submit}
placeholder='Code'
/>
);
if (!this.props.login.failure || this.props.login.error.error !== 'totp-required') {
return null;
}
return (
<TextInput
ref={ref => this.codeInput = ref}
style={styles.input_white}
onChangeText={code => this.setState({ code })}
keyboardType='numeric'
autoCorrect={false}
returnKeyType='done'
autoCapitalize='none'
onSubmitEditing={this.submit}
placeholder='Code'
/>
);
}
// {this.props.login.isFetching && <Text> LOGANDO</Text>}
@ -140,7 +141,6 @@ class LoginView extends React.Component {
<Text style={styles.link} onPress={this.privacyPolicy}> Privacy Policy</Text>
</Text>
</TouchableOpacity>
{this.props.login.failure && <Text style={styles.error}>{this.props.login.error.reason}</Text>}
</View>
</SafeAreaView>