diff --git a/package.json b/package.json index 9cb4e1465..01bf0a5ef 100644 --- a/package.json +++ b/package.json @@ -131,7 +131,7 @@ "json-loader": "^0.5.4", "lbry-format": "https://github.com/lbryio/lbry-format.git", "lbry-redux": "lbryio/lbry-redux#ee29e9a024f8a24e7eb70ecc901bb05ff3d4a87d", - "lbryinc": "lbryio/lbryinc#43fadef68d10f5f0727e3b94f6778164e94ae428", + "lbryinc": "lbryio/lbryinc#edd43c8dff63bccd86400719679c6fa864a9a342", "lint-staged": "^7.0.2", "localforage": "^1.7.1", "lodash-es": "^4.17.14", diff --git a/ui/component/userEmailNew/index.js b/ui/component/userEmailNew/index.js index 5c6065be1..e1a830b07 100644 --- a/ui/component/userEmailNew/index.js +++ b/ui/component/userEmailNew/index.js @@ -6,6 +6,7 @@ import { selectEmailAlreadyExists, doUserSignUp, doClearEmailEntry, + selectUser, } from 'lbryinc'; import { DAEMON_SETTINGS } from 'lbry-redux'; import { doSetClientSetting, doSetDaemonSetting } from 'redux/actions/settings'; @@ -18,6 +19,7 @@ const select = state => ({ syncEnabled: makeSelectClientSetting(SETTINGS.ENABLE_SYNC)(state), daemonSettings: selectDaemonSettings(state), emailExists: selectEmailAlreadyExists(state), + user: selectUser(state), }); const perform = dispatch => ({ diff --git a/ui/component/userEmailReturning/index.js b/ui/component/userEmailReturning/index.js index 1bc673140..2e8855b42 100644 --- a/ui/component/userEmailReturning/index.js +++ b/ui/component/userEmailReturning/index.js @@ -6,6 +6,7 @@ import { doClearEmailEntry, selectEmailDoesNotExist, selectEmailAlreadyExists, + selectUser, } from 'lbryinc'; import { doSetClientSetting } from 'redux/actions/settings'; import UserEmailReturning from './view'; @@ -15,6 +16,7 @@ const select = state => ({ emailToVerify: selectEmailToVerify(state), emailDoesNotExist: selectEmailDoesNotExist(state), emailExists: selectEmailAlreadyExists(state), + user: selectUser(state), }); export default connect(select, { diff --git a/ui/component/userEmailReturning/view.jsx b/ui/component/userEmailReturning/view.jsx index eeb0e251b..beaf98cab 100644 --- a/ui/component/userEmailReturning/view.jsx +++ b/ui/component/userEmailReturning/view.jsx @@ -11,6 +11,7 @@ import Card from 'component/common/card'; import Nag from 'component/common/nag'; type Props = { + user: ?User, errorMessage: ?string, emailToVerify: ?string, emailDoesNotExist: boolean, @@ -22,6 +23,7 @@ type Props = { function UserEmailReturning(props: Props) { const { + user, errorMessage, doUserCheckIfEmailExists, emailToVerify, @@ -34,11 +36,13 @@ function UserEmailReturning(props: Props) { const emailFromUrl = urlParams.get('email'); const emailExistsFromUrl = urlParams.get('email_exists'); const defaultEmail = emailFromUrl ? decodeURIComponent(emailFromUrl) : ''; + const hasPasswordSet = user && user.password_set; + const [email, setEmail] = useState(defaultEmail); const [syncEnabled, setSyncEnabled] = useState(true); const valid = email.match(EMAIL_REGEX); - const showEmailVerification = emailToVerify; + const showEmailVerification = emailToVerify || hasPasswordSet; function handleSubmit() { // @if TARGET='app' diff --git a/ui/component/userFirstChannel/view.jsx b/ui/component/userFirstChannel/view.jsx index 801903f93..8001c3ee9 100644 --- a/ui/component/userFirstChannel/view.jsx +++ b/ui/component/userFirstChannel/view.jsx @@ -18,7 +18,7 @@ type Props = { function UserFirstChannel(props: Props) { const { createChannel, creatingChannel, claimingReward, user, createChannelError } = props; const { primary_email: primaryEmail } = user; - const initialChannel = primaryEmail.split('@')[0]; + const initialChannel = primaryEmail ? primaryEmail.split('@')[0] : ''; const [channel, setChannel] = useState(initialChannel); const [nameError, setNameError] = useState(undefined); diff --git a/ui/component/userSignUp/view.jsx b/ui/component/userSignUp/view.jsx index 3b20c3dd5..f0afe83fe 100644 --- a/ui/component/userSignUp/view.jsx +++ b/ui/component/userSignUp/view.jsx @@ -69,6 +69,7 @@ function UserSignIn(props: Props) { const hasVerifiedEmail = user && user.has_verified_email; const rewardsApproved = user && user.is_reward_approved; const isIdentityVerified = user && user.is_identity_verified; + const passwordSet = user && user.password_set; const hasFetchedReward = useFetched(claimingReward); const channelCount = channels ? channels.length : 0; const hasClaimedEmailAward = claimedRewards.some(reward => reward.reward_type === REWARDS.TYPE_CONFIRM_EMAIL); @@ -84,7 +85,7 @@ function UserSignIn(props: Props) { // reward claiming, channel creation, account syncing, and youtube transfer // The possible screens for the sign in flow const showEmail = !hasVerifiedEmail; - const showEmailVerification = emailToVerify && !hasVerifiedEmail; + const showEmailVerification = (emailToVerify && !hasVerifiedEmail) || (!hasVerifiedEmail && passwordSet); const showUserVerification = hasVerifiedEmail && !rewardsApproved && !isIdentityVerified && !hasSkippedRewards; const showSyncPassword = syncEnabled && getSyncError; const showChannelCreation = diff --git a/yarn.lock b/yarn.lock index 9970dc44e..3ca6a6fea 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6147,9 +6147,9 @@ lbry-redux@lbryio/lbry-redux#ee29e9a024f8a24e7eb70ecc901bb05ff3d4a87d: reselect "^3.0.0" uuid "^3.3.2" -lbryinc@lbryio/lbryinc#43fadef68d10f5f0727e3b94f6778164e94ae428: +lbryinc@lbryio/lbryinc#edd43c8dff63bccd86400719679c6fa864a9a342: version "0.0.1" - resolved "https://codeload.github.com/lbryio/lbryinc/tar.gz/43fadef68d10f5f0727e3b94f6778164e94ae428" + resolved "https://codeload.github.com/lbryio/lbryinc/tar.gz/edd43c8dff63bccd86400719679c6fa864a9a342" dependencies: reselect "^3.0.0"