fix weird case where splash screen gets stuck on authenticating
This commit is contained in:
parent
f5ae1f34f7
commit
601c589f69
2 changed files with 9 additions and 6 deletions
|
@ -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));
|
||||
});
|
||||
});
|
||||
}
|
||||
// });
|
||||
|
|
Loading…
Reference in a new issue