fix(characters): reset route actors on character change

This commit is contained in:
2026-07-17 19:00:39 +08:00
parent 11c1747a68
commit 5bfb71e2b8
5 changed files with 213 additions and 7 deletions
@@ -1,11 +1,23 @@
import type { ReactNode } from "react";
import { notFound } from "next/navigation";
import { getCharacterBySlug } from "@/data/constants/character";
import { PaymentRouteProvider } from "@/providers/payment-route-provider";
export default function CharacterTipLayout({
export default async function CharacterTipLayout({
children,
params,
}: {
children: ReactNode;
params: Promise<{ characterSlug: string }>;
}) {
return <PaymentRouteProvider>{children}</PaymentRouteProvider>;
const { characterSlug } = await params;
const character = getCharacterBySlug(characterSlug);
if (!character) notFound();
return (
<PaymentRouteProvider scopeKey={character.id}>
{children}
</PaymentRouteProvider>
);
}