mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-10-02 16:20:36 -05:00
Don't load tournament main loader when navigating to match page
This commit is contained in:
@@ -5,6 +5,7 @@ import type {
|
||||
} from "@remix-run/node";
|
||||
import {
|
||||
Outlet,
|
||||
type ShouldRevalidateFunction,
|
||||
useLoaderData,
|
||||
useLocation,
|
||||
useOutletContext,
|
||||
@@ -36,6 +37,14 @@ import "../tournament.css";
|
||||
import "~/styles/maps.css";
|
||||
import "~/styles/calendar-event.css";
|
||||
|
||||
export const shouldRevalidate: ShouldRevalidateFunction = (args) => {
|
||||
const navigatedToMatchPage = typeof args.nextParams["mid"] === "string";
|
||||
|
||||
if (navigatedToMatchPage) return false;
|
||||
|
||||
return args.defaultShouldRevalidate;
|
||||
};
|
||||
|
||||
export const meta: MetaFunction = (args) => {
|
||||
const data = args.data as SerializeFrom<typeof loader>;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user