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,11 +62,13 @@ class LoginView extends React.Component {
} }
renderTOTP = () => { renderTOTP = () => {
if (this.props.login.errorMessage && this.props.login.errorMessage.error === 'totp-required') { if (!this.props.login.failure || this.props.login.error.error !== 'totp-required') {
return null;
}
return ( return (
<TextInput <TextInput
ref={ref => this.codeInput = ref} ref={ref => this.codeInput = ref}
style={styles.input} style={styles.input_white}
onChangeText={code => this.setState({ code })} onChangeText={code => this.setState({ code })}
keyboardType='numeric' keyboardType='numeric'
autoCorrect={false} autoCorrect={false}
@ -77,7 +79,6 @@ class LoginView extends React.Component {
/> />
); );
} }
}
// {this.props.login.isFetching && <Text> LOGANDO</Text>} // {this.props.login.isFetching && <Text> LOGANDO</Text>}
render() { render() {
@ -140,7 +141,6 @@ class LoginView extends React.Component {
<Text style={styles.link} onPress={this.privacyPolicy}> Privacy Policy</Text> <Text style={styles.link} onPress={this.privacyPolicy}> Privacy Policy</Text>
</Text> </Text>
</TouchableOpacity> </TouchableOpacity>
{this.props.login.failure && <Text style={styles.error}>{this.props.login.error.reason}</Text>} {this.props.login.failure && <Text style={styles.error}>{this.props.login.error.reason}</Text>}
</View> </View>
</SafeAreaView> </SafeAreaView>