hide the ChatBox instead of unmount it to prevent lose chat history.

This commit is contained in:
Xiaohan-Tian
2025-08-12 19:29:32 -07:00
parent f9fc309c91
commit 3534dc7fca
3 changed files with 40 additions and 22 deletions
+2 -2
View File
@@ -25,13 +25,13 @@ export const clearChatHistoryWithStatus = (setStatus?: (message: string) => void
};
// Global callback for clearing UI state
let globalClearChatUI: (() => void) | null = null;
let globalClearChatUI: (() => void | Promise<void>) | null = null;
/**
* Register a callback to clear chat UI state
* This allows external components to clear the ChatBox UI
*/
export const registerClearChatUICallback = (callback: () => void) => {
export const registerClearChatUICallback = (callback: () => void | Promise<void>) => {
globalClearChatUI = callback;
};