File tree Expand file tree Collapse file tree 3 files changed +19
-6
lines changed
components/challenges/hooks Expand file tree Collapse file tree 3 files changed +19
-6
lines changed Original file line number Diff line number Diff line change @@ -113,8 +113,8 @@ export function useCompletionFlow({ challenge }: UseCompletionFlowProps) {
113
113
setCurrentStep ( "commemorate" ) ;
114
114
}
115
115
} ,
116
- onError : ( ) => {
117
- setError ( "Network error. Please try again." ) ;
116
+ onError : ( e : { message ?: string } | undefined ) => {
117
+ setError ( e ?. message || "Network error. Please try again." ) ;
118
118
setCurrentStep ( "commemorate" ) ;
119
119
} ,
120
120
} ,
Original file line number Diff line number Diff line change @@ -103,8 +103,10 @@ function handleAuthSuccess(authContext: AuthContext): AuthContext {
103
103
104
104
if ( user . dorm && window . location . pathname === "/dorm-select" ) {
105
105
const urlParams = new URLSearchParams ( window . location . search ) ;
106
- const from = urlParams . get ( "from" ) || "/" ;
107
- throw redirect ( { to : from } ) ;
106
+ if ( urlParams . get ( "from" ) !== "/about" ) {
107
+ const from = urlParams . get ( "from" ) || "/" ;
108
+ throw redirect ( { to : from } ) ;
109
+ }
108
110
}
109
111
110
112
if ( ! user . dorm && window . location . pathname !== "/dorm-select" ) {
@@ -130,7 +132,6 @@ function handleRedirectLogic(
130
132
// User is authenticated and has a dorm, redirect
131
133
const urlParams = new URLSearchParams ( window . location . search ) ;
132
134
const from = urlParams . get ( "from" ) || "/" ;
133
-
134
135
throw redirect ( { to : from } ) ;
135
136
}
136
137
Original file line number Diff line number Diff line change 1
- import { createFileRoute , useNavigate } from "@tanstack/react-router" ;
1
+ import { createFileRoute , redirect , useNavigate } from "@tanstack/react-router" ;
2
2
import type { ButtonHTMLAttributes } from "react" ;
3
3
import Scotty from "@/assets/about-page-scotty.svg?react" ;
4
4
import {
@@ -122,6 +122,18 @@ function About() {
122
122
< AboutButton onClick = { ( ) => navigate ( { to : "/terrier-trade" } ) } >
123
123
Terrier Trade
124
124
</ AboutButton >
125
+
126
+ < AboutButton
127
+ onClick = { ( ) => {
128
+ const redirect =
129
+ new URL ( "/dorm-select" , window . location . origin ) . toString ( ) +
130
+ "?from=/about" ;
131
+
132
+ window . location . href = redirect ;
133
+ } }
134
+ >
135
+ Dorm Select
136
+ </ AboutButton >
125
137
</ div >
126
138
</ div >
127
139
) ;
You can’t perform that action at this time.
0 commit comments