diff --git a/CHANGELOG.md b/CHANGELOG.md index 6996b2ba3c..33de2c8aef 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,17 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [4.9.1] - 2023-09-14 + +### Changed + +- Removed YPP email pre-population +- Minor text changes in signup modal + +### Fixed + +- Fixed bug with missing anonymousId on signup + ## [4.9.0] - 2023-09-08 ### Added diff --git a/packages/atlas/atlas.config.yml b/packages/atlas/atlas.config.yml index 6747cf8548..0f0da3f5ec 100644 --- a/packages/atlas/atlas.config.yml +++ b/packages/atlas/atlas.config.yml @@ -43,12 +43,12 @@ features: landingPageOgImgPath: null # Path to the open graph image for the YPP landing page - if not set, the default image will be used googleConsoleClientId: '$VITE_GOOGLE_CONSOLE_CLIENT_ID' youtubeSyncApiUrl: '$VITE_YOUTUBE_SYNC_API_URL' - suspensionReasonsLink: https://www.notion.so/joystream/YouTube-Partner-Program-Outline-d492c2eb88ff4ace955b5f2902ec21fb?pvs=4#e03bb48ed7f7480c8896a908f63f2594 # Link with explanation what might be the reason of ypp channel suspension + suspensionReasonsLink: https://joystream.notion.site/My-channel-is-suspended-what-to-do-86a3df16c55c434ab2184d61dfcfc41b # Link with explanation what might be the reason of ypp channel suspension suspendedSupportLink: https://discord.com/channels/811216481340751934/1053294778529353788 # Link that will be displayed for users suspended in YPP suspendedLinkText: '#ypp-support channel on our Discord server' youtubeCollaboratorMemberId: '$VITE_YOUTUBE_COLLABORATOR_MEMBER_ID' enrollmentReward: 5000 # Amount for successful enrollment in YPP in joystream.tokenTicker units. - enrollmentUsdReward: 20 # Amount for successful enrollment in YPP in USD. + enrollmentUsdReward: 5 # Amount for successful enrollment in YPP in USD. referralBaseReward: 2.5 # Self-explanatory, it should match `baseUsdAmount.min` value in last `rewards` entry tiersDefinition: # Tiers for YouTube partner program rewards. You can provide maximum three tiers. Each tier should has own multiplier. tiers: diff --git a/packages/atlas/package.json b/packages/atlas/package.json index 474459d7b8..d0750b8fb2 100644 --- a/packages/atlas/package.json +++ b/packages/atlas/package.json @@ -1,7 +1,7 @@ { "name": "@joystream/atlas", "description": "UI for consuming Joystream - a user governed video platform", - "version": "4.9.0", + "version": "4.9.1", "license": "GPL-3.0", "scripts": { "start": "vite", diff --git a/packages/atlas/src/components/_auth/SignUpModal/SignUpModal.tsx b/packages/atlas/src/components/_auth/SignUpModal/SignUpModal.tsx index fbf8651e5b..b1aa641dc3 100644 --- a/packages/atlas/src/components/_auth/SignUpModal/SignUpModal.tsx +++ b/packages/atlas/src/components/_auth/SignUpModal/SignUpModal.tsx @@ -11,6 +11,7 @@ import { AccountFormData, FaucetError, MemberFormData, RegisterError, useCreateM import { useMediaMatch } from '@/hooks/useMediaMatch' import { useSegmentAnalytics } from '@/hooks/useSegmentAnalytics' import { useUniqueMemberHandle } from '@/hooks/useUniqueMemberHandle' +import { handleAnonymousAuth } from '@/providers/auth/auth.helpers' import { useAuthStore } from '@/providers/auth/auth.store' import { useSnackbar } from '@/providers/snackbars' import { useYppStore } from '@/providers/ypp/ypp.store' @@ -59,11 +60,12 @@ export const SignUpModal = () => { const [amountOfTokens, setAmountofTokens] = useState() const memberRef = useRef(null) const memberPollingTries = useRef(0) + const haveTriedCreateSession = useRef(false) const ytResponseData = useYppStore((state) => state.ytResponseData) const setYppModalOpenName = useYppStore((state) => state.actions.setYppModalOpenName) const setYtResponseData = useYppStore((state) => state.actions.setYtResponseData) + const { anonymousUserId } = useAuthStore() const { displaySnackbar } = useSnackbar() - const ytEmailIsValid = Boolean(ytResponseData?.email && !ytResponseData.email.includes('@pages.plusgoogle.com')) const { generateUniqueMemberHandleBasedOnInput } = useUniqueMemberHandle() @@ -131,6 +133,21 @@ export const SignUpModal = () => { }) setAuthModalOpenName(undefined) } + if (error === RegisterError.SessionRequired) { + if (!haveTriedCreateSession.current) { + haveTriedCreateSession.current = true + handleAnonymousAuth(anonymousUserId).then(() => { + handleOrionAccountCreation() + }) + } else { + displaySnackbar({ + title: 'Something went wrong', + description: 'We could not create or find session. Please contact support.', + iconType: 'error', + }) + setAuthModalOpenName(undefined) + } + } }, onStart: () => { goToStep(SignUpSteps.Creating) @@ -148,6 +165,7 @@ export const SignUpModal = () => { }, }) }, [ + anonymousUserId, createNewOrionAccount, displaySnackbar, goToNextStep, @@ -380,7 +398,7 @@ export const SignUpModal = () => { isOverflowing={overflow || !smMatch} isEmailAlreadyTakenError={emailAlreadyTakenError} onEmailSubmit={handleEmailStepSubmit} - email={signUpFormData.current.email || (ytEmailIsValid ? (ytResponseData?.email as string) : '')} + email={signUpFormData.current.email} confirmedTerms={signUpFormData.current.confirmedTerms} /> )} diff --git a/packages/atlas/src/components/_auth/SignUpModal/SignUpSteps/SignUpCreatingMemberStep.tsx b/packages/atlas/src/components/_auth/SignUpModal/SignUpSteps/SignUpCreatingMemberStep.tsx index ed3381d960..1a6c4c13e1 100644 --- a/packages/atlas/src/components/_auth/SignUpModal/SignUpSteps/SignUpCreatingMemberStep.tsx +++ b/packages/atlas/src/components/_auth/SignUpModal/SignUpSteps/SignUpCreatingMemberStep.tsx @@ -1,5 +1,8 @@ import { FC, useEffect } from 'react' +import { SvgAlertsWarning24 } from '@/assets/icons' +import { WarningContainer } from '@/components/_auth/SignUpModal/SignUpSteps/SignUpSteps.styles' + import { SignUpStepsCommonProps } from './SignUpSteps.types' import { AuthenticationModalStepTemplate } from '../../AuthenticationModalStepTemplate' @@ -16,7 +19,18 @@ export const SignUpCreatingMemberStep: FC = ({ setPrimar return ( + Please wait while your membership is being created. Our faucet server will create it for you so you don't need + to worry about any fees. This may take up to 1 minute on a slow network. +
+
+ + + Please do not close the browser tab or reload the page. + + + } loader hasNavigatedBack={hasNavigatedBack} /> diff --git a/packages/atlas/src/components/_auth/SignUpModal/SignUpSteps/SignUpSteps.styles.ts b/packages/atlas/src/components/_auth/SignUpModal/SignUpSteps/SignUpSteps.styles.ts index f457f81e4f..1fc30796b4 100644 --- a/packages/atlas/src/components/_auth/SignUpModal/SignUpSteps/SignUpSteps.styles.ts +++ b/packages/atlas/src/components/_auth/SignUpModal/SignUpSteps/SignUpSteps.styles.ts @@ -21,3 +21,9 @@ export const StyledLink = styled.a` color: ${cVar('colorTextPrimary')}; text-decoration: underline; ` + +export const WarningContainer = styled.span` + display: flex; + justify-content: flex-start; + align-items: center; +` diff --git a/packages/atlas/src/hooks/useCreateMember.ts b/packages/atlas/src/hooks/useCreateMember.ts index 58b21f4f46..82e5c26db2 100644 --- a/packages/atlas/src/hooks/useCreateMember.ts +++ b/packages/atlas/src/hooks/useCreateMember.ts @@ -70,6 +70,7 @@ export enum RegisterError { EmailAlreadyExists = 'EmailAlreadyExists', UnknownError = 'UnknownError', MembershipNotFound = 'MembershipNotFound', + SessionRequired = 'SessionRequired', } type SignUpParams = { @@ -241,9 +242,13 @@ export const useCreateMember = () => { 'To create new membership you need to use an email that is not connected to already existing account.', }) onError?.(RegisterError.EmailAlreadyExists) + return } else if (errorMessage.startsWith('Membership not found by id')) { onError?.(RegisterError.MembershipNotFound) return + } else if (errorMessage.startsWith("cookie 'session_id' required")) { + onError?.(RegisterError.SessionRequired) + return } else { displaySnackbar({ title: 'Something went wrong', diff --git a/packages/atlas/src/providers/auth/auth.provider.tsx b/packages/atlas/src/providers/auth/auth.provider.tsx index 4df318459e..82bd8c97a3 100644 --- a/packages/atlas/src/providers/auth/auth.provider.tsx +++ b/packages/atlas/src/providers/auth/auth.provider.tsx @@ -1,4 +1,3 @@ -import { useApolloClient } from '@apollo/client' import { u8aToHex } from '@polkadot/util' import { cryptoWaitReady } from '@polkadot/util-crypto' import { isAxiosError } from 'axios' @@ -39,7 +38,6 @@ export const AuthProvider: FC = ({ children }) => { const [lazyCurrentAccountQuery, { refetch }] = useGetCurrentAccountLazyQuery() const { setApiActiveAccount } = useJoystream() const { identifyUser, trackLogout } = useSegmentAnalytics() - const client = useApolloClient() const { anonymousUserId, encodedSeed, @@ -56,13 +54,6 @@ export const AuthProvider: FC = ({ children }) => { const { data } = await lazyCurrentAccountQuery() if (!data) { handleAnonymousAuth(anonymousUserId).then((userId) => { - client.refetchQueries({ - include: 'active', - onQueryUpdated: (observableQuery) => { - // don't refetch GetBasicVideos query, as it's a duplicate of GetBasicVideosLightweight - return observableQuery.queryName !== 'GetBasicVideos' - }, - }) setAnonymousUserId(userId ?? null) }) setIsAuthenticating(false) diff --git a/packages/atlas/src/views/studio/YppDashboard/tabs/YppDashboardMainTab.tsx b/packages/atlas/src/views/studio/YppDashboard/tabs/YppDashboardMainTab.tsx index 545ec7b7f3..24bdcea48f 100644 --- a/packages/atlas/src/views/studio/YppDashboard/tabs/YppDashboardMainTab.tsx +++ b/packages/atlas/src/views/studio/YppDashboard/tabs/YppDashboardMainTab.tsx @@ -46,10 +46,6 @@ export const YppDashboardMainTab: FC = ({ currentTier - . If you have questions, we are happy to help in our{' '} - . }