refactor(chat): reorganize helper functions and update imports
This commit is contained in:
@@ -9,7 +9,7 @@ import { Logger } from "@/utils/logger";
|
||||
import { Result } from "@/utils/result";
|
||||
|
||||
import type { ChatEvent } from "../../chat-events";
|
||||
import { sendResponseToUiMessage } from "../../chat-machine.helpers";
|
||||
import { sendResponseToUiMessage } from "../../helper/message-mappers";
|
||||
|
||||
const log = new Logger("StoresChatChatSendFlow");
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ import { readAndSyncHistory } from "../../chat-history-sync";
|
||||
import {
|
||||
type UnlockMessageRequest,
|
||||
type UnlockMessageOutput,
|
||||
} from "../../chat-machine.helpers";
|
||||
} from "../../helper/unlock";
|
||||
|
||||
const log = new Logger("StoresChatChatUnlockFlow");
|
||||
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
import {
|
||||
applyHistoryLoadedOutput,
|
||||
applyNetworkHistoryLoadedOutput,
|
||||
} from "../helper/history";
|
||||
import {
|
||||
countLockedHistoryMessages,
|
||||
shouldPromptUnlockHistory,
|
||||
} from "../chat-machine.helpers";
|
||||
} from "../helper/unlock";
|
||||
import { baseChatMachineSetup } from "./setup";
|
||||
|
||||
const applyLocalHistoryLoadedAction = baseChatMachineSetup.assign(
|
||||
|
||||
@@ -8,7 +8,7 @@ import {
|
||||
beginPendingReply,
|
||||
finishPendingReply,
|
||||
type HttpSendOutput,
|
||||
} from "../chat-machine.helpers";
|
||||
} from "../helper/send-state";
|
||||
import { historyMachineSetup } from "./history-flow";
|
||||
import { createChatActorActionSetup } from "./setup";
|
||||
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
import {
|
||||
createChatPromotionState,
|
||||
shouldPromptUnlockHistory,
|
||||
} from "../chat-machine.helpers";
|
||||
import { createChatPromotionState } from "../helper/promotion";
|
||||
import { shouldPromptUnlockHistory } from "../helper/unlock";
|
||||
import { initialState } from "../chat-state";
|
||||
import {
|
||||
guestInitializingState,
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import { type DoneActorEvent } from "xstate";
|
||||
|
||||
import { applyPromotionUnlockOutput } from "../helper/promotion";
|
||||
import {
|
||||
applyPromotionUnlockOutput,
|
||||
applySingleUnlockOutput,
|
||||
countLockedHistoryMessages,
|
||||
type UnlockMessageOutput,
|
||||
} from "../chat-machine.helpers";
|
||||
} from "../helper/unlock";
|
||||
import type { UnlockHistoryOutput } from "./actors/unlock";
|
||||
import { sendMachineSetup } from "./send-flow";
|
||||
import { createChatActorActionSetup } from "./setup";
|
||||
|
||||
Reference in New Issue
Block a user