spencercarli / react-native-meteor-boilerplate

MIT License
628 stars 139 forks source link

Meteor Login Logic creates a weird issue for me #62

Closed kevando closed 7 years ago

kevando commented 7 years ago

The condition at react-native-meteor-boilerplate/RNApp/app/index.js

if (status.connected === false || loggingIn) {
    return <Loading />;
  } else if (user !== null) {
    return <LoggedIn />;
  }
  return <LoggedOut />;
};

I get a weird issue where the user is authenticated, but the user object is null for a split second and the login screen flashes. Any idea how to fix this?

kevando commented 7 years ago

I was also thinking if it would make sense to save a 'authStatus' with AsyncStorage so that this conditional can fire much quicker in the event the login status a few seconds. Would that make sense?

kevando commented 7 years ago

I foolishly used AND operator on the first logic statement -_- Changed it to an OR and it works great. Thanks again for this dope repo!

spencercarli commented 7 years ago

Doh! Glad you got it sorted out