feat(characters): support character-scoped conversations

This commit is contained in:
2026-07-17 11:42:31 +08:00
parent 93efcb6604
commit 2796010971
85 changed files with 1645 additions and 251 deletions
+11 -2
View File
@@ -2,17 +2,26 @@
import type { ReactNode } from "react";
import { DEFAULT_CHARACTER_ID } from "@/data/constants/character";
import { ChatProvider } from "@/stores/chat/chat-context";
import { PaymentProvider } from "@/stores/payment/payment-context";
import { ChatAuthSync } from "@/stores/sync/chat-auth-sync";
import { ChatPaymentSuccessSync } from "@/stores/sync/chat-payment-success-sync";
import { PaymentSuccessSync } from "@/stores/sync/payment-success-sync";
export function ChatRouteProviders({ children }: { children: ReactNode }) {
export interface ChatRouteProvidersProps {
children: ReactNode;
characterId?: string;
}
export function ChatRouteProviders({
children,
characterId = DEFAULT_CHARACTER_ID,
}: ChatRouteProvidersProps) {
return (
<PaymentProvider>
<PaymentSuccessSync />
<ChatProvider>
<ChatProvider characterId={characterId}>
<ChatAuthSync />
<ChatPaymentSuccessSync />
{children}
+13 -4
View File
@@ -2,12 +2,21 @@
import type { ReactNode } from "react";
import { DEFAULT_CHARACTER_ID } from "@/data/constants/character";
import { PrivateRoomProvider } from "@/stores/private-room";
export interface PrivateRoomRouteProviderProps {
children: ReactNode;
characterId?: string;
}
export function PrivateRoomRouteProvider({
children,
}: {
children: ReactNode;
}) {
return <PrivateRoomProvider>{children}</PrivateRoomProvider>;
characterId = DEFAULT_CHARACTER_ID,
}: PrivateRoomRouteProviderProps) {
return (
<PrivateRoomProvider characterId={characterId}>
{children}
</PrivateRoomProvider>
);
}