diff --git a/src/component/AppNavigator.js b/src/component/AppNavigator.js index db24edb..f5aefa5 100644 --- a/src/component/AppNavigator.js +++ b/src/component/AppNavigator.js @@ -29,8 +29,9 @@ import { import { connect } from 'react-redux'; import { AppState, BackHandler, Linking, NativeModules, TextInput, ToastAndroid } from 'react-native'; import { selectDrawerStack } from 'redux/selectors/drawer'; -import { SETTINGS, doDismissToast, doToast, selectToast } from 'lbry-redux'; +import { SETTINGS, doDismissToast, doPopulateSharedUserState, doToast, selectToast } from 'lbry-redux'; import { + Lbryio, doGetSync, doUserCheckEmailVerified, doUserEmailVerify, @@ -305,6 +306,13 @@ class AppWithNavigationState extends React.Component { }); }; + getUserSettings = () => { + const { dispatch } = this.props; + Lbryio.call('user_settings', 'get').then(settings => { + dispatch(doPopulateSharedUserState(settings)); + }); + }; + componentWillUnmount() { AppState.removeEventListener('change', this._handleAppStateChange); BackHandler.removeEventListener('hardwareBackPress'); @@ -321,12 +329,16 @@ class AppWithNavigationState extends React.Component { NativeModules.Firebase.track('email_verified', { email: user.primary_email }); ToastAndroid.show('Your email address was successfully verified.', ToastAndroid.LONG); + // get user settings after email verification + this.getUserSettings(); + // upon successful email verification, do wallet sync (if password has been set) - NativeModules.UtilityModule.getSecureValue(Constants.KEY_FIRST_RUN_PASSWORD).then(walletPassword => { + // don't need to do this anymore... + /* NativeModules.UtilityModule.getSecureValue(Constants.KEY_FIRST_RUN_PASSWORD).then(walletPassword => { if (walletPassword && walletPassword.trim().length > 0) { dispatch(doGetSync(walletPassword)); } - }); + }); */ } } diff --git a/src/page/verification/internal/sync-verify-page.js b/src/page/verification/internal/sync-verify-page.js index 6862733..8bccb37 100644 --- a/src/page/verification/internal/sync-verify-page.js +++ b/src/page/verification/internal/sync-verify-page.js @@ -43,7 +43,7 @@ class SyncVerifyPage extends React.PureComponent { navigation.goBack(); }); } else { - syncApply(syncHash, syncData, this.state.password); + syncApply(syncHash, syncData, this.state.password ? this.state.password : ''); } }); };