diff --git a/src/component/drawerContent/view.js b/src/component/drawerContent/view.js
index 61205f7..6838025 100644
--- a/src/component/drawerContent/view.js
+++ b/src/component/drawerContent/view.js
@@ -54,7 +54,11 @@ class DrawerContent extends React.PureComponent {
launchSignInFlow = () => {
// for now, sync flow (email, then password input) will be the default sign in flow
const { navigation } = this.props;
- navigation.navigate({ routeName: 'Verification', key: 'verification', params: { syncFlow: true } });
+ navigation.navigate({
+ routeName: 'Verification',
+ key: 'verification',
+ params: { syncFlow: true, signInFlow: true },
+ });
};
render() {
diff --git a/src/component/walletSignIn/view.js b/src/component/walletSignIn/view.js
index d9941ae..4dc895d 100644
--- a/src/component/walletSignIn/view.js
+++ b/src/component/walletSignIn/view.js
@@ -16,7 +16,11 @@ class WalletSignIn extends React.Component {
onSignInPressed = () => {
const { navigation } = this.props;
- navigation.navigate({ routeName: 'Verification', key: 'verification', params: { syncFlow: true } });
+ navigation.navigate({
+ routeName: 'Verification',
+ key: 'verification',
+ params: { syncFlow: true, signInFlow: true },
+ });
};
render() {
diff --git a/src/page/splash/view.js b/src/page/splash/view.js
index e288417..d4ab2ea 100644
--- a/src/page/splash/view.js
+++ b/src/page/splash/view.js
@@ -159,7 +159,6 @@ class SplashScreen extends React.PureComponent {
this.setState({ shouldAuthenticate: true });
NativeModules.Firebase.getMessagingToken()
.then(firebaseToken => {
- console.log(firebaseToken);
authenticate(appVersion, Platform.OS, firebaseToken);
})
.catch(() => authenticate(appVersion, Platform.OS));
diff --git a/src/page/verification/index.js b/src/page/verification/index.js
index 82a412f..4a645ba 100644
--- a/src/page/verification/index.js
+++ b/src/page/verification/index.js
@@ -1,5 +1,5 @@
import { connect } from 'react-redux';
-import { doToast } from 'lbry-redux';
+import { doToast, doPopulateSharedUserState } from 'lbry-redux';
import {
doCheckSync,
doGetSync,
@@ -58,6 +58,7 @@ const perform = dispatch => ({
checkSync: () => dispatch(doCheckSync()),
verifyPhone: verificationCode => dispatch(doUserPhoneVerify(verificationCode)),
notify: data => dispatch(doToast(data)),
+ populateSharedUserState: settings => dispatch(doPopulateSharedUserState(settings)),
setClientSetting: (key, value) => dispatch(doSetClientSetting(key, value)),
setEmailToVerify: email => dispatch(doUserEmailToVerify(email)),
syncApply: (hash, data, password) => dispatch(doSyncApply(hash, data, password)),
diff --git a/src/page/verification/internal/sync-verify-page.js b/src/page/verification/internal/sync-verify-page.js
index 8185196..7990c8a 100644
--- a/src/page/verification/internal/sync-verify-page.js
+++ b/src/page/verification/internal/sync-verify-page.js
@@ -112,7 +112,7 @@ class SyncVerifyPage extends React.PureComponent {
};
render() {
- const { hasSyncedWallet, syncApplyIsPending } = this.props;
+ const { hasSyncedWallet, syncApplyIsPending, signInFlow } = this.props;
let paragraph;
if (!hasSyncedWallet) {
@@ -194,7 +194,7 @@ class SyncVerifyPage extends React.PureComponent {
)}
diff --git a/src/page/verification/view.js b/src/page/verification/view.js
index 91318d1..630d055 100644
--- a/src/page/verification/view.js
+++ b/src/page/verification/view.js
@@ -1,10 +1,11 @@
import React from 'react';
-import { Lbry } from 'lbry-redux';
+import { Lbry, doPreferenceGet } from 'lbry-redux';
import { ActivityIndicator, Linking, NativeModules, Text, TouchableOpacity, View } from 'react-native';
import { NavigationActions, StackActions } from 'react-navigation';
import AsyncStorage from '@react-native-community/async-storage';
import Colors from 'styles/colors';
import Constants from 'constants'; // eslint-disable-line node/no-deprecated-api
+import Icon from 'react-native-vector-icons/FontAwesome5';
import EmailVerifyPage from './internal/email-verify-page';
import ManualVerifyPage from './internal/manual-verify-page';
import PhoneVerifyPage from './internal/phone-verify-page';
@@ -19,6 +20,7 @@ class VerificationScreen extends React.PureComponent {
showSkip: false,
skipAccountConfirmed: false,
showBottomContainer: true,
+ signInFlow: false,
walletPassword: null,
isEmailVerificationPhase: false,
isEmailVerified: false,
@@ -27,7 +29,9 @@ class VerificationScreen extends React.PureComponent {
};
componentDidMount() {
- const { user } = this.props;
+ const { user, navigation } = this.props;
+ const { signInFlow } = navigation.state.params;
+ this.setState({ signInFlow });
this.checkVerificationStatus(user);
NativeModules.Firebase.setCurrentScreen('Verification');
}
@@ -36,8 +40,22 @@ class VerificationScreen extends React.PureComponent {
this.setState({ isEmailVerificationPhase: value });
};
+ getUserSettings = () => {
+ const { populateSharedUserState } = this.props;
+
+ doPreferenceGet(
+ 'shared',
+ preference => {
+ populateSharedUserState(preference);
+ },
+ error => {
+ /* failed */
+ }
+ );
+ };
+
checkVerificationStatus = user => {
- const { deviceWalletSynced, navigation } = this.props;
+ const { deviceWalletSynced, getSync, navigation } = this.props;
const { syncFlow } = navigation.state.params;
this.setState(
@@ -57,7 +75,13 @@ class VerificationScreen extends React.PureComponent {
}
if (this.state.isEmailVerified && syncFlow && deviceWalletSynced) {
- navigation.goBack();
+ // retrieve user settings
+ NativeModules.UtilityModule.getSecureValue(Constants.KEY_WALLET_PASSWORD).then(walletPassword => {
+ getSync(walletPassword, () => {
+ this.getUserSettings();
+ navigation.goBack();
+ });
+ });
}
} else {
if (this.state.isEmailVerified && !this.state.isIdentityVerified && !this.state.isRewardApproved) {
@@ -167,6 +191,7 @@ class VerificationScreen extends React.PureComponent {
syncApply={syncApply}
syncData={syncData}
syncHash={syncHash}
+ signInFlow={this.state.signInFlow}
/>
);
break;
@@ -182,7 +207,7 @@ class VerificationScreen extends React.PureComponent {
{!this.state.isEmailVerificationPhase && (
- x
+
)}
diff --git a/src/styles/firstRun.js b/src/styles/firstRun.js
index 29203d2..eadcf9e 100644
--- a/src/styles/firstRun.js
+++ b/src/styles/firstRun.js
@@ -153,6 +153,10 @@ const firstRunStyle = StyleSheet.create({
color: Colors.White,
fontSize: 16,
},
+ closeButtonIcon: {
+ alignSelf: 'center',
+ color: Colors.White,
+ },
buttonContainer: {
flexDirection: 'row',
alignItems: 'center',