remove getSync wait before navigation to main

This commit is contained in:
Akinwale Ariwodola 2019-10-17 18:19:45 +01:00
parent 9080913811
commit 9ec5ac5d60

View file

@ -91,11 +91,9 @@ class SplashScreen extends React.PureComponent {
// user is authenticated, navigate to the main view
if (user.has_verified_email) {
NativeModules.UtilityModule.getSecureValue(Constants.KEY_WALLET_PASSWORD).then(walletPassword => {
getSync(walletPassword, () => {
this.getUserSettings();
getSync(walletPassword, () => this.getUserSettings());
this.navigateToMain();
});
});
return;
}
@ -130,7 +128,8 @@ class SplashScreen extends React.PureComponent {
user,
} = this.props;
Lbry.resolve({ urls: 'lbry://one' }).then(() => {
Lbry.resolve({ urls: 'lbry://one' })
.then(() => {
// Leave the splash screen
balanceSubscribe();
blacklistedOutpointsSubscribe();
@ -140,11 +139,9 @@ class SplashScreen extends React.PureComponent {
if (user && user.id && user.has_verified_email) {
// user already authenticated
NativeModules.UtilityModule.getSecureValue(Constants.KEY_WALLET_PASSWORD).then(walletPassword => {
getSync(walletPassword, err => {
this.getUserSettings();
getSync(walletPassword, () => this.getUserSettings());
this.navigateToMain();
});
});
} else {
NativeModules.VersionInfo.getAppVersion().then(appVersion => {
NativeModules.Firebase.getMessagingToken().then(firebaseToken => {
@ -153,7 +150,8 @@ class SplashScreen extends React.PureComponent {
});
});
}
});
})
.catch(err => console.log(err));
};
handleAccountUnlockFailed() {