always navigate to first run if not completed

This commit is contained in:
Akinwale Ariwodola 2019-11-14 23:07:28 +01:00
parent e901e81074
commit 2ddfc1eaf8

View file

@ -44,24 +44,20 @@ class FirstRunScreen extends React.PureComponent {
} }
}); });
if (NativeModules.FirstRun) { // FirstRun module should always be present (in order to detect first run status)
NativeModules.FirstRun.isFirstRun().then(firstRun => { NativeModules.FirstRun.isFirstRun().then(firstRun => {
AsyncStorage.removeItem(Constants.KEY_FIRST_RUN_EMAIL); AsyncStorage.removeItem(Constants.KEY_FIRST_RUN_EMAIL);
AsyncStorage.removeItem(Constants.KEY_EMAIL_VERIFY_PENDING); AsyncStorage.removeItem(Constants.KEY_EMAIL_VERIFY_PENDING);
this.setState({ isFirstRun: firstRun }); this.setState({ isFirstRun: firstRun });
if (firstRun) { if (firstRun) {
NativeModules.Firebase.setCurrentScreen('First Run'); NativeModules.Firebase.setCurrentScreen('First Run');
this.setState({ currentPage: FirstRunScreen.pages[0] }); this.setState({ currentPage: FirstRunScreen.pages[0] });
} else { } else {
// Not the first run. Navigate to the splash screen right away // Not the first run. Navigate to the splash screen right away
this.launchSplashScreen(); this.launchSplashScreen();
} }
}); });
} else {
// The first run module was not detected. Go straight to the splash screen.
this.launchSplashScreen();
}
} }
componentWillReceiveProps(nextProps) { componentWillReceiveProps(nextProps) {