Commit 601c589f authored by Akinwale Ariwodola's avatar Akinwale Ariwodola
Browse files

fix weird case where splash screen gets stuck on authenticating

parent f5ae1f34
......@@ -10,6 +10,7 @@ import {
doUserEmailToVerify,
doUserEmailVerify,
doUserEmailVerifyFailure,
selectAuthenticationIsPending,
selectUser,
selectEmailToVerify,
} from 'lbryinc';
......@@ -18,6 +19,7 @@ import { selectLastRouteInStack } from 'redux/selectors/drawer';
import SplashScreen from './view';
const select = state => ({
authIsPending: selectAuthenticationIsPending(state),
user: selectUser(state),
emailToVerify: selectEmailToVerify(state),
lastRouteInStack: selectLastRouteInStack(state),
......
......@@ -139,12 +139,13 @@ class SplashScreen extends React.PureComponent {
this.navigateToMain();
} else {
NativeModules.VersionInfo.getAppVersion().then(appVersion => {
this.setState({ shouldAuthenticate: true });
NativeModules.Firebase.getMessagingToken()
.then(firebaseToken => {
authenticate(appVersion, Platform.OS, firebaseToken);
})
.catch(() => authenticate(appVersion, Platform.OS));
this.setState({ shouldAuthenticate: true }, () => {
NativeModules.Firebase.getMessagingToken()
.then(firebaseToken => {
authenticate(appVersion, Platform.OS, firebaseToken);
})
.catch(() => authenticate(appVersion, Platform.OS));
});
});
}
// });
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment