This repository was archived by the owner on Jan 31, 2025. It is now read-only.
File tree 4 files changed +12
-8
lines changed
routes/_authenticated/_layout 4 files changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -37,8 +37,9 @@ export const router = createRouter({
37
37
} ,
38
38
// Since we're using React Query, we don't want loader calls to ever be stale
39
39
// This will ensure that the loader is always called when the route is preloaded or visited
40
- defaultPreload : "intent" ,
40
+ defaultStaleTime : Number . POSITIVE_INFINITY ,
41
41
defaultPendingComponent : PageLayout . Root . Skeleton ,
42
+ defaultPreloadStaleTime : 0 ,
42
43
defaultOnCatch : ( error ) => {
43
44
Sentry . captureException ( error ) ;
44
45
} ,
Original file line number Diff line number Diff line change 8
8
SheetTrigger ,
9
9
} from "@rivet-gg/components" ;
10
10
import { Icon , faBars } from "@rivet-gg/icons" ;
11
- import { Link , useLocation } from "@tanstack/react-router" ;
11
+ import { Link } from "@tanstack/react-router" ;
12
12
import { Breadcrumbs } from "../breadcrumbs/breadcrumbs" ;
13
13
import { MobileBreadcrumbs } from "../breadcrumbs/mobile-breadcrumbs" ;
14
14
import { Changelog } from "./changelog" ;
@@ -36,7 +36,6 @@ const UserProfileButton = () => {
36
36
} ;
37
37
38
38
export function Header ( ) {
39
- const location = useLocation ( ) ;
40
39
return (
41
40
< header className = "bg-background/60 sticky top-0 z-10 flex items-center gap-4 border-b py-2 backdrop-blur" >
42
41
< HeaderRouteLoader />
Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ export async function guardEnterprise({
32
32
}
33
33
}
34
34
35
- export async function guardOssNewie ( {
35
+ export async function guardOssNewbie ( {
36
36
queryClient,
37
37
auth,
38
38
} : { queryClient : QueryClient ; auth : AuthContext } ) {
@@ -55,14 +55,15 @@ export async function guardOssNewie({
55
55
projectId : projects [ 0 ] . gameId ,
56
56
environmentId : namespaces [ 0 ] . namespaceId ,
57
57
} ,
58
+ from : "/" ,
58
59
} ) ;
59
60
}
60
-
61
61
throw redirect ( {
62
62
to : "/projects/$projectId" ,
63
63
params : {
64
64
projectId : projects [ 0 ] . gameId ,
65
65
} ,
66
+ from : "/" ,
66
67
} ) ;
67
68
}
68
69
@@ -74,13 +75,15 @@ export async function guardOssNewie({
74
75
throw redirect ( {
75
76
to : "/teams/$groupId" ,
76
77
params : { groupId : lastTeam } ,
78
+ from : "/" ,
77
79
} ) ;
78
80
}
79
81
80
82
if ( groups . length > 0 ) {
81
83
throw redirect ( {
82
84
to : "/teams/$groupId" ,
83
85
params : { groupId : groups [ 0 ] . groupId } ,
86
+ from : "/" ,
84
87
} ) ;
85
88
}
86
89
}
Original file line number Diff line number Diff line change 1
1
import { Intro } from "@/components/intro" ;
2
2
import { DeepDiveSection } from "@/components/sections/deep-dive-section" ;
3
3
import { FaqSection } from "@/components/sections/faq-section" ;
4
- import { guardOssNewie } from "@/lib/guards" ;
4
+ import { guardOssNewbie } from "@/lib/guards" ;
5
5
import { H1 , NarrowPage , Separator } from "@rivet-gg/components" ;
6
6
import { createFileRoute } from "@tanstack/react-router" ;
7
7
import { zodSearchValidator } from "@tanstack/router-zod-adapter" ;
@@ -35,10 +35,11 @@ const searchSchema = z.object({
35
35
export const Route = createFileRoute ( "/_authenticated/_layout/" ) ( {
36
36
validateSearch : zodSearchValidator ( searchSchema ) ,
37
37
component : IndexRoute ,
38
- beforeLoad : async ( { search, context : { queryClient, auth } } ) => {
38
+ beforeLoad : ( { search, context : { queryClient, auth } } ) => {
39
39
if ( search . newbie === true ) {
40
40
return ;
41
41
}
42
- await guardOssNewie ( { queryClient, auth } ) ;
42
+ return guardOssNewbie ( { queryClient, auth } ) ;
43
43
} ,
44
+ shouldReload : true ,
44
45
} ) ;
You can’t perform that action at this time.
0 commit comments