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,
|
doUserEmailToVerify,
|
||||||
doUserEmailVerify,
|
doUserEmailVerify,
|
||||||
doUserEmailVerifyFailure,
|
doUserEmailVerifyFailure,
|
||||||
|
selectAuthenticationIsPending,
|
||||||
selectUser,
|
selectUser,
|
||||||
selectEmailToVerify,
|
selectEmailToVerify,
|
||||||
} from 'lbryinc';
|
} from 'lbryinc';
|
||||||
|
@ -18,6 +19,7 @@ import { selectLastRouteInStack } from 'redux/selectors/drawer';
|
||||||
import SplashScreen from './view';
|
import SplashScreen from './view';
|
||||||
|
|
||||||
const select = state => ({
|
const select = state => ({
|
||||||
|
authIsPending: selectAuthenticationIsPending(state),
|
||||||
user: selectUser(state),
|
user: selectUser(state),
|
||||||
emailToVerify: selectEmailToVerify(state),
|
emailToVerify: selectEmailToVerify(state),
|
||||||
lastRouteInStack: selectLastRouteInStack(state),
|
lastRouteInStack: selectLastRouteInStack(state),
|
||||||
|
|
|
@ -139,12 +139,13 @@ class SplashScreen extends React.PureComponent {
|
||||||
this.navigateToMain();
|
this.navigateToMain();
|
||||||
} else {
|
} else {
|
||||||
NativeModules.VersionInfo.getAppVersion().then(appVersion => {
|
NativeModules.VersionInfo.getAppVersion().then(appVersion => {
|
||||||
this.setState({ shouldAuthenticate: true });
|
this.setState({ shouldAuthenticate: true }, () => {
|
||||||
NativeModules.Firebase.getMessagingToken()
|
NativeModules.Firebase.getMessagingToken()
|
||||||
.then(firebaseToken => {
|
.then(firebaseToken => {
|
||||||
authenticate(appVersion, Platform.OS, firebaseToken);
|
authenticate(appVersion, Platform.OS, firebaseToken);
|
||||||
})
|
})
|
||||||
.catch(() => authenticate(appVersion, Platform.OS));
|
.catch(() => authenticate(appVersion, Platform.OS));
|
||||||
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
// });
|
// });
|
||||||
|
|
Loading…
Reference in a new issue