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
2 changes: 1 addition & 1 deletion packages/web/e2e/signUp.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ async function testSignUp({
})
).toBeVisible({ timeout: 60000 }) // This can take a long time
await page.getByRole('button', { name: /start listening/i }).click()
await expect(page).toHaveURL(/feed/i)
await expect(page).toHaveURL(/trending/i)
}

test.describe('Sign Up', () => {
Expand Down
12 changes: 11 additions & 1 deletion packages/web/src/pages/sign-on-page/SignOnPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
import { SignInPage } from 'pages/sign-in-page'
import SignUpPage from 'pages/sign-up-page'
import { NavHeader } from 'pages/sign-up-page/components/NavHeader'
import { getSignUpCompletionRoute } from 'pages/sign-up-page/utils/getSignUpCompletionRoute'
import landingImg from 'public-site/pages/landing-2026/assets/landing.png'

const {
Expand Down Expand Up @@ -317,9 +318,18 @@
const SignOnRoot = isMobile ? MobileSignOnRoot : DesktopSignOnRoot
const location = useLocation()
const isSignUp = location.pathname.startsWith(SIGN_UP_PAGE)
const signInCompletionRoute = completionRoute ? completionRoute : FEED_PAGE

Check failure on line 321 in packages/web/src/pages/sign-on-page/SignOnPage.tsx

View workflow job for this annotation

GitHub Actions / Web Lint & Stylelint

Unnecessary use of conditional expression for default assignment

if (signOnStatus === EditingStatus.SUCCESS) {
return <Navigate to={completionRoute || FEED_PAGE} />
return (
<Navigate
to={
startedSignUpProcess
? getSignUpCompletionRoute(completionRoute)
: signInCompletionRoute
}
/>
)
}

return (
Expand Down
4 changes: 2 additions & 2 deletions packages/web/src/pages/sign-up-page/SignUpPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import { Navigate, Route, Routes, useLocation } from 'react-router'

import { getRouteOnCompletion } from 'common/store/pages/signon/selectors'
import { getSignUpCompletionRoute } from 'pages/sign-up-page/utils/getSignUpCompletionRoute'
import { useDetermineAllowedRoute } from 'pages/sign-up-page/utils/useDetermineAllowedRoutes'

import { CreateEmailPage } from './pages/CreateEmailPage'
Expand All @@ -20,7 +21,6 @@
import { RouteContextProvider } from './utils/RouteContext'

const {
FEED_PAGE,
TRENDING_PAGE,
SIGN_UP_APP_CTA_PAGE,
SIGN_UP_ARTISTS_PAGE,
Expand Down Expand Up @@ -161,7 +161,7 @@
path='completed'
element={
<SignUpRoute path={SIGN_UP_COMPLETED_REDIRECT}>
<Navigate to={completionRoute || FEED_PAGE} replace />
<Navigate to={getSignUpCompletionRoute(completionRoute)} replace />

Check failure on line 164 in packages/web/src/pages/sign-up-page/SignUpPage.tsx

View workflow job for this annotation

GitHub Actions / Web Lint & Stylelint

Replace `·to={getSignUpCompletionRoute(completionRoute)}·replace` with `⏎················to={getSignUpCompletionRoute(completionRoute)}⏎················replace⏎·············`
</SignUpRoute>
}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export const MobileAppCtaPage = () => {
const status = useSelector(getStatus)

const handleContinue = useCallback(() => {
// If account creation is complete, go to feed
// If account creation is complete, go to the post-signup landing page
// Otherwise, show loading screen until account is ready
if (status === EditingStatus.SUCCESS) {
navigate(SIGN_UP_COMPLETED_REDIRECT)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { FEED_PAGE, TRENDING_PAGE } from '@audius/common/src/utils/route'

export const getSignUpCompletionRoute = (completionRoute: string) => {
if (completionRoute === FEED_PAGE) {
return TRENDING_PAGE
}

return completionRoute ? completionRoute : TRENDING_PAGE

Check failure on line 8 in packages/web/src/pages/sign-up-page/utils/getSignUpCompletionRoute.ts

View workflow job for this annotation

GitHub Actions / Web Lint & Stylelint

Unnecessary use of conditional expression for default assignment
}
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