From cc0b1aea657c84b77154513ea8d4242416e95f79 Mon Sep 17 00:00:00 2001 From: Sean Yesmunt Date: Tue, 15 Sep 2020 10:23:00 -0400 Subject: [PATCH] add backout option for youtube sync and fix scroll reset --- ui/component/userChannelFollowIntro/view.jsx | 2 +- ui/component/userSignUp/view.jsx | 2 +- ui/page/youtubeSync/view.jsx | 12 +++++++++++- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/ui/component/userChannelFollowIntro/view.jsx b/ui/component/userChannelFollowIntro/view.jsx index 76245c50d..122c5313c 100644 --- a/ui/component/userChannelFollowIntro/view.jsx +++ b/ui/component/userChannelFollowIntro/view.jsx @@ -58,7 +58,7 @@ function UserChannelFollowIntro(props: Props) { defaultOrderBy={CS.ORDER_BY_TOP} defaultFreshness={CS.FRESH_ALL} claimType="channel" - defaultTags={CS.TAGS_FOLLOWED} + defaultTags={followingCount > 3 ? CS.TAGS_FOLLOWED : undefined} /> {followingCount > 0 && ( + ) : ( )), diff --git a/ui/page/youtubeSync/view.jsx b/ui/page/youtubeSync/view.jsx index f07fe3553..595df7051 100644 --- a/ui/page/youtubeSync/view.jsx +++ b/ui/page/youtubeSync/view.jsx @@ -22,13 +22,15 @@ type Props = { youtubeChannels: ?Array<{ transfer_state: string, sync_status: string }>, doUserFetch: () => void, inSignUpFlow?: boolean, + doToggleInterestedInYoutubeSync: () => void, }; export default function YoutubeSync(props: Props) { - const { youtubeChannels, doUserFetch, inSignUpFlow = false } = props; + const { youtubeChannels, doUserFetch, inSignUpFlow = false, doToggleInterestedInYoutubeSync } = props; const { location: { search, pathname }, push, + replace, } = useHistory(); const urlParams = new URLSearchParams(search); const statusToken = urlParams.get(STATUS_TOKEN_PARAM); @@ -40,6 +42,10 @@ export default function YoutubeSync(props: Props) { const [addingNewChannel, setAddingNewChannel] = React.useState(newChannelParam); const hasYoutubeChannels = youtubeChannels && youtubeChannels.length > 0; + React.useEffect(() => { + replace(`?reset_scroll=youtube`); + }, []); + React.useEffect(() => { if (statusToken && !hasYoutubeChannels) { doUserFetch(); @@ -160,6 +166,10 @@ export default function YoutubeSync(props: Props) { label={__('Claim Now')} /> + {inSignUpFlow && !errorMessage && ( +