refactor(characters): drive shared UI from active character
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
import { fromCallback, fromPromise } from "xstate";
|
||||
|
||||
import { DEFAULT_CHARACTER_ID } from "@/data/constants/character";
|
||||
import {
|
||||
DEFAULT_CHARACTER,
|
||||
DEFAULT_CHARACTER_ID,
|
||||
} from "@/data/constants/character";
|
||||
import {
|
||||
ChatSendResponseSchema,
|
||||
UnlockPrivateResponseSchema,
|
||||
@@ -36,6 +39,7 @@ export interface TestUnlockMessageOutput {
|
||||
|
||||
export const TEST_CHAT_MACHINE_INPUT = {
|
||||
characterId: DEFAULT_CHARACTER_ID,
|
||||
emptyChatGreeting: DEFAULT_CHARACTER.emptyChatGreeting,
|
||||
};
|
||||
|
||||
export function makeChatSendResponse(): ChatSendResponse {
|
||||
@@ -109,7 +113,10 @@ export function createTestChatMachine(
|
||||
return () => undefined;
|
||||
},
|
||||
),
|
||||
unlockHistory: fromPromise<UnlockHistoryOutput, { characterId: string }>(
|
||||
unlockHistory: fromPromise<
|
||||
UnlockHistoryOutput,
|
||||
{ characterId: string; emptyChatGreeting: string }
|
||||
>(
|
||||
async () => {
|
||||
if (options.unlockHistoryError) {
|
||||
throw options.unlockHistoryError;
|
||||
|
||||
Reference in New Issue
Block a user