File tree 2 files changed +10
-1
lines changed 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -34,6 +34,15 @@ export default function App(): React.ReactElement {
34
34
}
35
35
} , [ setUser , user ] ) ;
36
36
37
+ useEffect ( ( ) => {
38
+ const params = new URLSearchParams ( location . search ) ;
39
+ const existing = params . get ( "existing" ) ;
40
+
41
+ if ( ! existing ) return ;
42
+
43
+ location . replace ( `${ location . origin } /#${ existing } ?forceRefresh=true` ) ;
44
+ } , [ ] ) ;
45
+
37
46
useEffect ( ( ) => {
38
47
if ( searchParams . get ( "forceRefresh" ) ) {
39
48
displayToast ( "Session reloaded as you were timed out." ) ;
Original file line number Diff line number Diff line change 1
1
export const callApi = async ( toCall : string , init ?: RequestInit | undefined ) : Promise < Response > => {
2
2
const response = await fetch ( `${ import . meta. env . VITE_API_PATH } ${ toCall } ` , init )
3
3
if ( response . status == 400 ) {
4
- location . replace ( `${ location . protocol } //${ location . host } /#/?forceRefresh=true ` )
4
+ location . replace ( `${ location . protocol } //${ location . host } /?existing= ${ location . hash . substring ( 1 ) } ` )
5
5
}
6
6
return response
7
7
}
You can’t perform that action at this time.
0 commit comments