diff --git a/frontend/app/src/components/chat/chat-controller.ts b/frontend/app/src/components/chat/chat-controller.ts index 710d0672..8b8a71e2 100644 --- a/frontend/app/src/components/chat/chat-controller.ts +++ b/frontend/app/src/components/chat/chat-controller.ts @@ -206,6 +206,14 @@ export class ChatController({ const ChatControllerContext = createContext(null); -export function ChatsProvider ({ onChatCreated, children }: { children: ReactNode, onChatCreated?: (id: string, chat: Chat, controller: ChatController) => void }) { +export function ChatsProvider ({ onChatCreated, children }: { children: ReactNode, /** @deprecated */onChatCreated?: (id: string, chat: Chat, controller: ChatController) => void }) { const bootstrapStatusRef = useLatestRef(useBootstrapStatus()); const [chats, setChats] = useState(() => new Map); diff --git a/frontend/packages/widget-react/src/Widget.tsx b/frontend/packages/widget-react/src/Widget.tsx index a2ffbfdb..8d7b743b 100644 --- a/frontend/packages/widget-react/src/Widget.tsx +++ b/frontend/packages/widget-react/src/Widget.tsx @@ -140,13 +140,7 @@ export const Widget = forwardRef(({ container, trig - { - window.dispatchEvent(new CustomEvent('tidbainewchat', { - detail: { id }, - })); - }} - > + { setOpen(open); if (!open) {