mirror of
https://github.com/Monadical-SAS/reflector.git
synced 2025-12-20 20:29:06 +00:00
tweak prefetch on links
This commit is contained in:
@@ -118,6 +118,7 @@ export default async function RootLayout({ children, params }: LayoutProps) {
|
||||
<Link
|
||||
href="/browse"
|
||||
className="hover:underline focus-within:underline underline-offset-2 decoration-[.5px] font-light px-2"
|
||||
prefetch={false}
|
||||
>
|
||||
Browse
|
||||
</Link>
|
||||
|
||||
@@ -8,6 +8,11 @@ export async function middleware(request: NextRequest) {
|
||||
const domain = request.nextUrl.hostname;
|
||||
const config = await getConfig(domain);
|
||||
|
||||
if (
|
||||
request.nextUrl.pathname.match(
|
||||
"/((?!api|_next/static|_next/image|favicon.ico).*)",
|
||||
)
|
||||
) {
|
||||
// Feature-flag protedted paths
|
||||
if (
|
||||
!config.features.browse &&
|
||||
@@ -31,7 +36,6 @@ export async function middleware(request: NextRequest) {
|
||||
request.nextUrl.origin + "/" + domain + request.nextUrl.pathname,
|
||||
);
|
||||
}
|
||||
console.log(fiefResponse);
|
||||
}
|
||||
return fiefResponse;
|
||||
}
|
||||
@@ -45,6 +49,7 @@ export async function middleware(request: NextRequest) {
|
||||
request.nextUrl.origin + "/" + domain + request.nextUrl.pathname,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
return NextResponse.next();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user