mirror of
https://github.com/trafficlunar/tomodachi-share.git
synced 2026-05-13 13:17:45 +00:00
fix: cache control on index page?
This commit is contained in:
parent
3a5243fa3e
commit
144240e278
1 changed files with 1 additions and 15 deletions
|
|
@ -1,15 +1,12 @@
|
|||
import { Metadata } from "next";
|
||||
import { redirect } from "next/navigation";
|
||||
import { Suspense } from "react";
|
||||
import { Icon } from "@iconify/react";
|
||||
|
||||
import { auth } from "@/lib/auth";
|
||||
import { prisma } from "@/lib/prisma";
|
||||
|
||||
import Countdown from "@/components/countdown";
|
||||
import MiiList from "@/components/mii/list";
|
||||
import Skeleton from "@/components/mii/list/skeleton";
|
||||
|
||||
export const dynamic = "force-static";
|
||||
export const revalidate = 60;
|
||||
|
||||
interface Props {
|
||||
|
|
@ -38,19 +35,8 @@ export async function generateMetadata({ searchParams }: Props): Promise<Metadat
|
|||
}
|
||||
|
||||
export default async function Page({ searchParams }: Props) {
|
||||
const session = await auth();
|
||||
const { page, tags } = await searchParams;
|
||||
|
||||
if (session?.user) {
|
||||
const activePunishment = await prisma.punishment.findFirst({
|
||||
where: {
|
||||
userId: Number(session?.user.id),
|
||||
returned: false,
|
||||
},
|
||||
});
|
||||
if (activePunishment) redirect("/off-the-island");
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<h1 className="sr-only">{tags ? `Miis tagged with '${tags}' - TomodachiShare` : "TomodachiShare - index mii list"}</h1>
|
||||
|
|
|
|||
Loading…
Reference in a new issue