do not proceed past Setup account without an email address

This commit is contained in:
Akinwale Ariwodola 2019-06-07 06:21:09 +01:00
parent 044947d4ae
commit 20da1b6461
2 changed files with 14 additions and 17 deletions

View file

@ -38,11 +38,11 @@ class EmailCollectPage extends React.PureComponent {
// save the value to the state email // save the value to the state email
const { onEmailChanged } = this.props; const { onEmailChanged } = this.props;
this.setState({ email: text }); this.setState({ email: text });
AsyncStorage.setItem(Constants.KEY_FIRST_RUN_EMAIL, text);
AsyncStorage.setItem(Constants.KEY_EMAIL_VERIFY_PENDING, 'true');
if (onEmailChanged) { if (onEmailChanged) {
onEmailChanged(text); onEmailChanged(text);
} }
AsyncStorage.setItem(Constants.KEY_FIRST_RUN_EMAIL, text);
AsyncStorage.setItem(Constants.KEY_EMAIL_VERIFY_PENDING, 'true');
} }
render() { render() {

View file

@ -182,8 +182,7 @@ class FirstRunScreen extends React.PureComponent {
handleEmailCollectPageContinue() { handleEmailCollectPageContinue() {
const { notify, addUserEmail } = this.props; const { notify, addUserEmail } = this.props;
const { email } = this.state;
AsyncStorage.getItem(Constants.KEY_FIRST_RUN_EMAIL).then(email => {
// validate the email // validate the email
if (!email || email.indexOf('@') === -1) { if (!email || email.indexOf('@') === -1) {
return notify({ return notify({
@ -193,7 +192,6 @@ class FirstRunScreen extends React.PureComponent {
addUserEmail(email); addUserEmail(email);
this.setState({ emailSubmitted: true }); this.setState({ emailSubmitted: true });
});
} }
checkBottomContainer = (pageName) => { checkBottomContainer = (pageName) => {
@ -238,10 +236,9 @@ class FirstRunScreen extends React.PureComponent {
} }
onEmailViewLayout = () => { onEmailViewLayout = () => {
this.setState({ showBottomContainer: true }); this.setState({ showBottomContainer: true, showSkip: true });
AsyncStorage.getItem('firstRunEmail').then(email => { AsyncStorage.removeItem(Constants.KEY_FIRST_RUN_EMAIL);
this.setState({ showSkip: !email || email.trim().length === 0 }); AsyncStorage.removeItem(Constants.KEY_EMAIL_VERIFY_PENDING);
});
} }
onWalletPasswordChanged = (password) => { onWalletPasswordChanged = (password) => {