Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions packages/web/src/pages/sign-on-page/SignOnPage.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ReactNode, useEffect, useLayoutEffect } from 'react'

import { SystemAppearance } from '@audius/common/models'
import { FEED_PAGE } from '@audius/common/src/utils/route'
import { FEED_PAGE, TRENDING_PAGE } from '@audius/common/src/utils/route'
import { themeSelectors } from '@audius/common/store'
import { route } from '@audius/common/utils'
import {
Expand Down Expand Up @@ -317,9 +317,14 @@ export const SignOnPage = () => {
const SignOnRoot = isMobile ? MobileSignOnRoot : DesktopSignOnRoot
const location = useLocation()
const isSignUp = location.pathname.startsWith(SIGN_UP_PAGE)
const signUpCompletionRoute =
completionRoute === FEED_PAGE ? TRENDING_PAGE : completionRoute
const successRoute = startedSignUpProcess
? (signUpCompletionRoute ?? TRENDING_PAGE)
: (completionRoute ?? FEED_PAGE)

if (signOnStatus === EditingStatus.SUCCESS) {
return <Navigate to={completionRoute || FEED_PAGE} />
return <Navigate to={successRoute} />
}

return (
Expand Down
4 changes: 3 additions & 1 deletion packages/web/src/pages/sign-up-page/SignUpPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ function SignUpRoute({

export const SignUpPage = () => {
const completionRoute = useSelector(getRouteOnCompletion)
const defaultCompletionRoute =
completionRoute === FEED_PAGE ? TRENDING_PAGE : completionRoute

return (
<RouteContextProvider>
Expand Down Expand Up @@ -161,7 +163,7 @@ export const SignUpPage = () => {
path='completed'
element={
<SignUpRoute path={SIGN_UP_COMPLETED_REDIRECT}>
<Navigate to={completionRoute || FEED_PAGE} replace />
<Navigate to={defaultCompletionRoute ?? TRENDING_PAGE} replace />
</SignUpRoute>
}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { env } from 'services/env'

import { useFastReferral } from '../hooks/useFastReferral'

const { FEED_PAGE, SignUpPath } = route
const { TRENDING_PAGE, SignUpPath } = route

const isDevEnvironment =
env.ENVIRONMENT === 'development' ||
Expand Down Expand Up @@ -63,7 +63,7 @@ export const useDetermineAllowedRoute = () => {
return {
allowedRoutes: [],
isAllowedRoute: false,
correctedRoute: FEED_PAGE
correctedRoute: TRENDING_PAGE
}
}
// Normalize path: strip /signup/ or signup/ prefix and trailing slash so "select-genres" always matches
Expand Down
Loading