This repository was archived by the owner on Jan 31, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +12
-8
lines changed
routes/_authenticated/_layout Expand file tree Collapse file tree 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({
3737 } ,
3838 // Since we're using React Query, we don't want loader calls to ever be stale
3939 // This will ensure that the loader is always called when the route is preloaded or visited
40- defaultPreload : "intent" ,
40+ defaultStaleTime : Number . POSITIVE_INFINITY ,
4141 defaultPendingComponent : PageLayout . Root . Skeleton ,
42+ defaultPreloadStaleTime : 0 ,
4243 defaultOnCatch : ( error ) => {
4344 Sentry . captureException ( error ) ;
4445 } ,
Original file line number Diff line number Diff line change 88 SheetTrigger ,
99} from "@rivet-gg/components" ;
1010import { Icon , faBars } from "@rivet-gg/icons" ;
11- import { Link , useLocation } from "@tanstack/react-router" ;
11+ import { Link } from "@tanstack/react-router" ;
1212import { Breadcrumbs } from "../breadcrumbs/breadcrumbs" ;
1313import { MobileBreadcrumbs } from "../breadcrumbs/mobile-breadcrumbs" ;
1414import { Changelog } from "./changelog" ;
@@ -36,7 +36,6 @@ const UserProfileButton = () => {
3636} ;
3737
3838export function Header ( ) {
39- const location = useLocation ( ) ;
4039 return (
4140 < header className = "bg-background/60 sticky top-0 z-10 flex items-center gap-4 border-b py-2 backdrop-blur" >
4241 < HeaderRouteLoader />
Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ export async function guardEnterprise({
3232 }
3333}
3434
35- export async function guardOssNewie ( {
35+ export async function guardOssNewbie ( {
3636 queryClient,
3737 auth,
3838} : { queryClient : QueryClient ; auth : AuthContext } ) {
@@ -55,14 +55,15 @@ export async function guardOssNewie({
5555 projectId : projects [ 0 ] . gameId ,
5656 environmentId : namespaces [ 0 ] . namespaceId ,
5757 } ,
58+ from : "/" ,
5859 } ) ;
5960 }
60-
6161 throw redirect ( {
6262 to : "/projects/$projectId" ,
6363 params : {
6464 projectId : projects [ 0 ] . gameId ,
6565 } ,
66+ from : "/" ,
6667 } ) ;
6768 }
6869
@@ -74,13 +75,15 @@ export async function guardOssNewie({
7475 throw redirect ( {
7576 to : "/teams/$groupId" ,
7677 params : { groupId : lastTeam } ,
78+ from : "/" ,
7779 } ) ;
7880 }
7981
8082 if ( groups . length > 0 ) {
8183 throw redirect ( {
8284 to : "/teams/$groupId" ,
8385 params : { groupId : groups [ 0 ] . groupId } ,
86+ from : "/" ,
8487 } ) ;
8588 }
8689}
Original file line number Diff line number Diff line change 11import { Intro } from "@/components/intro" ;
22import { DeepDiveSection } from "@/components/sections/deep-dive-section" ;
33import { FaqSection } from "@/components/sections/faq-section" ;
4- import { guardOssNewie } from "@/lib/guards" ;
4+ import { guardOssNewbie } from "@/lib/guards" ;
55import { H1 , NarrowPage , Separator } from "@rivet-gg/components" ;
66import { createFileRoute } from "@tanstack/react-router" ;
77import { zodSearchValidator } from "@tanstack/router-zod-adapter" ;
@@ -35,10 +35,11 @@ const searchSchema = z.object({
3535export const Route = createFileRoute ( "/_authenticated/_layout/" ) ( {
3636 validateSearch : zodSearchValidator ( searchSchema ) ,
3737 component : IndexRoute ,
38- beforeLoad : async ( { search, context : { queryClient, auth } } ) => {
38+ beforeLoad : ( { search, context : { queryClient, auth } } ) => {
3939 if ( search . newbie === true ) {
4040 return ;
4141 }
42- await guardOssNewie ( { queryClient, auth } ) ;
42+ return guardOssNewbie ( { queryClient, auth } ) ;
4343 } ,
44+ shouldReload : true ,
4445} ) ;
You can’t perform that action at this time.
0 commit comments