From 79686ff6b9ffbb41851fc7bb0b4b7ed823c4bcb0 Mon Sep 17 00:00:00 2001 From: Akinwale Ariwodola Date: Thu, 7 Nov 2019 17:13:37 +0100 Subject: [PATCH] restore user preferences after in-app sign in flow --- src/component/drawerContent/view.js | 6 +++- src/component/walletSignIn/view.js | 6 +++- src/page/splash/view.js | 1 - src/page/verification/index.js | 3 +- .../verification/internal/sync-verify-page.js | 4 +-- src/page/verification/view.js | 35 ++++++++++++++++--- src/styles/firstRun.js | 4 +++ 7 files changed, 48 insertions(+), 11 deletions(-) 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 {