diff --git a/src/views/pages/ChatPanel.tsx b/src/views/pages/ChatPanel.tsx index 73dbdd6..7fe856a 100644 --- a/src/views/pages/ChatPanel.tsx +++ b/src/views/pages/ChatPanel.tsx @@ -9,12 +9,12 @@ import { useViewportSize, } from "@mantine/hooks"; import messageUtil from "@/util/MessageUtil"; +import APIUtil from "@/util/APIUtil"; import StopButton from "@/views/components/StopButton"; import RegenerationButton from "@/views/components/RegenerationButton"; import { observer } from "mobx-react-lite"; import { useMst } from "@/views/stores/RootStore"; import { Message } from "@/views/stores/ChatStore"; -import type { Item } from "@/views/stores/InputStore"; import InputMessage from "@/views/components/InputMessage"; import MessageList from "@/views/components/MessageList"; @@ -155,6 +155,10 @@ const chatPanel = observer(() => { chat.updateFeatures(message.features); } ); + messageUtil.registerHandler("codeDiffApply", (_: any) => { + const e = 'code_diff_apply' + APIUtil.createEvent({name: e, value: e}) + }) messageUtil.sendMessage({ command: "regCommandList" }); diff --git a/src/views/stores/ChatStore.ts b/src/views/stores/ChatStore.ts index 43c8f36..f075129 100644 --- a/src/views/stores/ChatStore.ts +++ b/src/views/stores/ChatStore.ts @@ -3,7 +3,6 @@ import messageUtil from "@/util/MessageUtil"; import { ChatContext } from "@/views/stores/InputStore"; import yaml from "js-yaml"; import { RootInstance } from "./RootStore"; -import { useTranslation } from "react-i18next"; import i18next from "i18next"; import APIUtil from "@/util/APIUtil"; @@ -174,10 +173,6 @@ export const ChatStore = types self.currentMessage = ""; const config = getParent(self).config const chatModel = config.getDefaultModel(); - messageUtil.registerHandler("codeDiffApply", (_: any) => { - const e = 'code_diff_apply' - APIUtil.createEvent({name: e, value: e}) - }) messageUtil.sendMessage({ command: "sendMessage", text: text,