only sync for users with a verified email address #68
1 changed files with 6 additions and 4 deletions
|
@ -297,16 +297,18 @@ class AppWithNavigationState extends React.Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
const { dispatch } = this.props;
|
const { dispatch, user } = this.props;
|
||||||
this.emailVerifyCheckInterval = setInterval(() => this.checkEmailVerification(), 5000);
|
this.emailVerifyCheckInterval = setInterval(() => this.checkEmailVerification(), 5000);
|
||||||
Linking.addEventListener('url', this._handleUrl);
|
Linking.addEventListener('url', this._handleUrl);
|
||||||
|
|
||||||
// call /sync/get with interval
|
// call /sync/get with interval
|
||||||
this.syncGetInterval = setInterval(() => {
|
this.syncGetInterval = setInterval(() => {
|
||||||
this.setState({ syncHashChanged: false }); // reset local state
|
this.setState({ syncHashChanged: false }); // reset local state
|
||||||
NativeModules.UtilityModule.getSecureValue(Constants.KEY_WALLET_PASSWORD).then(walletPassword => {
|
if (user && user.has_verified_email) {
|
||||||
dispatch(doGetSync(walletPassword, () => this.getUserSettings()));
|
NativeModules.UtilityModule.getSecureValue(Constants.KEY_WALLET_PASSWORD).then(walletPassword => {
|
||||||
});
|
dispatch(doGetSync(walletPassword, () => this.getUserSettings()));
|
||||||
|
});
|
||||||
|
}
|
||||||
}, SYNC_GET_INTERVAL);
|
}, SYNC_GET_INTERVAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue