refactor(characters): drive shared UI from active character
This commit is contained in:
@@ -2,7 +2,10 @@ import type { UiMessage } from "@/stores/chat/ui-message";
|
||||
import type { PendingChatUnlockKind } from "@/lib/navigation/chat_unlock_session";
|
||||
import type { ChatLockType } from "@/data/schemas/chat";
|
||||
import type { PendingChatPromotion } from "@/data/storage/navigation";
|
||||
import { DEFAULT_CHARACTER_ID } from "@/data/constants/character";
|
||||
import {
|
||||
DEFAULT_CHARACTER,
|
||||
DEFAULT_CHARACTER_ID,
|
||||
} from "@/data/constants/character";
|
||||
import type { ChatPromotionState } from "./helper/promotion";
|
||||
|
||||
export type ChatUpgradeReason = "insufficient_credits";
|
||||
@@ -26,6 +29,7 @@ export interface ChatUnlockPaywallRequest
|
||||
|
||||
export interface ChatState {
|
||||
characterId: string;
|
||||
emptyChatGreeting: string;
|
||||
messages: UiMessage[];
|
||||
promotion: ChatPromotionState | null;
|
||||
outgoingMessageRevision: number;
|
||||
@@ -55,9 +59,11 @@ export interface ChatState {
|
||||
|
||||
export function createInitialChatState(
|
||||
characterId: string = DEFAULT_CHARACTER_ID,
|
||||
emptyChatGreeting: string = DEFAULT_CHARACTER.emptyChatGreeting,
|
||||
): ChatState {
|
||||
return {
|
||||
characterId,
|
||||
emptyChatGreeting,
|
||||
messages: [],
|
||||
promotion: null,
|
||||
outgoingMessageRevision: 0,
|
||||
|
||||
Reference in New Issue
Block a user