Skip to content

Commit

Permalink
Revert scout page to be the first page
Browse files Browse the repository at this point in the history
  • Loading branch information
valentinludu committed Dec 6, 2024
1 parent 2988a31 commit 920a6ab
Show file tree
Hide file tree
Showing 10 changed files with 12 additions and 10 deletions.
2 changes: 1 addition & 1 deletion apps/scoutgame/__e2e__/onboarding.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ test.describe('Onboarding flow', () => {
expect(user.agreedToTermsAt).not.toBeNull();
expect(user.email).toBe(email);

await Promise.all([page.waitForURL('**/quests', { waitUntil: 'load' }), welcomePage.continueButton.click()]);
await Promise.all([page.waitForURL('**/scout', { waitUntil: 'load' }), welcomePage.continueButton.click()]);

await expect(scoutPage.container).toBeVisible();

Expand Down
4 changes: 3 additions & 1 deletion apps/scoutgame/__e2e__/scoutPage.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ test.describe('Scout page', () => {

await page.goto('/');
// Logged in user should be redirected
await page.waitForURL('**/welcome');
await page.waitForURL('**/scout');

await expect(scoutPage.container).toBeVisible();
});
test('Can navigate to each scouts table tab', async ({ page, scoutPage, utils }) => {
// add some mock data
Expand Down
2 changes: 1 addition & 1 deletion apps/scoutgame/app/(general)/builders-you-know/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export const metadata: Metadata = {
export default async function BuildersYouKnow() {
const user = await getUserFromSession();

const redirectPath = '/quests';
const redirectPath = '/scout';

if (!user?.farcasterId) {
redirect(redirectPath);
Expand Down
2 changes: 1 addition & 1 deletion apps/scoutgame/components/common/Header/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export function Header() {
variant='dense'
>
<>
<Link href={user ? '/quests' : '/'}>
<Link href={user ? '/scout' : '/'}>
<Image
src='/images/scout-game-logo.png'
width={100}
Expand Down
2 changes: 1 addition & 1 deletion apps/scoutgame/components/common/SiteNavigation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export function SiteNavigation({ topNav }: { topNav?: boolean }) {
const { data: claimablePoints } = useGetClaimablePoints();
const [authPopup, setAuthPopup] = useState({
open: false,
path: '/quests'
path: '/scout'
});

const openAuthModal = isAuthenticated
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ function WalletLoginButton() {
isExecuting: isLoggingIn
} = useAction(loginWithWalletAction, {
onSuccess: async ({ data }) => {
const nextPage = !data?.onboarded ? '/welcome' : inviteCode ? '/welcome/builder' : redirectUrl || '/quests';
const nextPage = !data?.onboarded ? '/welcome' : inviteCode ? '/welcome/builder' : redirectUrl || '/scout';

if (!data?.success) {
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export function WarpcastLoginButton() {
result
} = useAction(loginWithFarcasterAction, {
onSuccess: async ({ data }) => {
const nextPage = !data?.onboarded ? '/welcome' : inviteCode ? '/welcome/builder' : redirectUrl || '/quests';
const nextPage = !data?.onboarded ? '/welcome' : inviteCode ? '/welcome/builder' : redirectUrl || '/scout';

if (!data?.success) {
return;
Expand Down
2 changes: 1 addition & 1 deletion apps/scoutgame/components/common/WelcomeModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { useState, useEffect } from 'react';

import { HowItWorksContent } from 'components/welcome/how-it-works/HowItWorksContent';

const pagesToShowOnboarding = ['/quests'];
const pagesToShowOnboarding = ['/scout', '/u/'];

function WelcomeModal({ userId }: { userId?: string }) {
const [isOpen, setIsOpen] = useState(false);
Expand Down
2 changes: 1 addition & 1 deletion apps/scoutgame/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export async function middleware(request: NextRequest) {
if (isLoggedIn && (path === '/login' || path === '/')) {
// eslint-disable-next-line no-console
console.log('Redirecting to home page', session);
return NextResponse.redirect(new URL('/quests', request.url));
return NextResponse.redirect(new URL('/scout', request.url));
}

return response;
Expand Down
2 changes: 1 addition & 1 deletion apps/scoutgametelegram/app/(info)/welcome/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export default async function Welcome() {
const user = await getUserFromSession({ sameSite: 'none' });

if (user?.onboardedAt && user?.agreedToTermsAt) {
redirect('/quests');
redirect('/scout');
}

return <WelcomePage />;
Expand Down

0 comments on commit 920a6ab

Please sign in to comment.