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