From 2ddfc1eaf8595801f6b80822aef2af6cbf8a3774 Mon Sep 17 00:00:00 2001 From: Akinwale Ariwodola Date: Thu, 14 Nov 2019 23:07:28 +0100 Subject: [PATCH] always navigate to first run if not completed --- src/page/firstRun/view.js | 30 +++++++++++++----------------- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/src/page/firstRun/view.js b/src/page/firstRun/view.js index ffeb8f8..a136287 100644 --- a/src/page/firstRun/view.js +++ b/src/page/firstRun/view.js @@ -44,24 +44,20 @@ class FirstRunScreen extends React.PureComponent { } }); - if (NativeModules.FirstRun) { - NativeModules.FirstRun.isFirstRun().then(firstRun => { - AsyncStorage.removeItem(Constants.KEY_FIRST_RUN_EMAIL); - AsyncStorage.removeItem(Constants.KEY_EMAIL_VERIFY_PENDING); - this.setState({ isFirstRun: firstRun }); + // FirstRun module should always be present (in order to detect first run status) + NativeModules.FirstRun.isFirstRun().then(firstRun => { + AsyncStorage.removeItem(Constants.KEY_FIRST_RUN_EMAIL); + AsyncStorage.removeItem(Constants.KEY_EMAIL_VERIFY_PENDING); + this.setState({ isFirstRun: firstRun }); - if (firstRun) { - NativeModules.Firebase.setCurrentScreen('First Run'); - this.setState({ currentPage: FirstRunScreen.pages[0] }); - } else { - // Not the first run. Navigate to the splash screen right away - this.launchSplashScreen(); - } - }); - } else { - // The first run module was not detected. Go straight to the splash screen. - this.launchSplashScreen(); - } + if (firstRun) { + NativeModules.Firebase.setCurrentScreen('First Run'); + this.setState({ currentPage: FirstRunScreen.pages[0] }); + } else { + // Not the first run. Navigate to the splash screen right away + this.launchSplashScreen(); + } + }); } componentWillReceiveProps(nextProps) { -- 2.45.2