Merge pull request #69 from lbryio/wait-for-sync

wait for getSync to complete and apply user settings
This commit is contained in:
Akinwale Ariwodola 2019-10-28 16:36:41 +01:00 committed by GitHub
commit b4fc61ada0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 7 deletions

4
package-lock.json generated
View file

@ -5649,8 +5649,8 @@
}
},
"lbryinc": {
"version": "github:lbryio/lbryinc#aebad10a9c5d725c3fedae4236d56f239a0bc1de",
"from": "github:lbryio/lbryinc#aebad10a9c5d725c3fedae4236d56f239a0bc1de",
"version": "github:lbryio/lbryinc#27b6fcb8391b54cc9ea4d0a52a6ee536e39aa166",
"from": "github:lbryio/lbryinc#27b6fcb8391b54cc9ea4d0a52a6ee536e39aa166",
"requires": {
"reselect": "^3.0.0"
}

View file

@ -13,7 +13,7 @@
"@expo/vector-icons": "^8.1.0",
"gfycat-style-urls": "^1.0.3",
"lbry-redux": "lbryio/lbry-redux#8ac92e3abfa0a9aacdb2fa4a144c3fadc4da6b11",
"lbryinc": "lbryio/lbryinc#aebad10a9c5d725c3fedae4236d56f239a0bc1de",
"lbryinc": "lbryio/lbryinc#27b6fcb8391b54cc9ea4d0a52a6ee536e39aa166",
"lodash": ">=4.17.11",
"merge": ">=1.2.1",
"moment": "^2.22.1",

View file

@ -91,8 +91,10 @@ 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());
this.navigateToMain();
getSync(walletPassword, () => {
this.getUserSettings();
this.navigateToMain();
});
});
return;
}
@ -138,8 +140,10 @@ 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, () => this.getUserSettings());
this.navigateToMain();
getSync(walletPassword, () => {
this.getUserSettings();
this.navigateToMain();
});
});
} else {
NativeModules.VersionInfo.getAppVersion().then(appVersion => {