From cbd1d98bc356c1b2ce2b737b0af9104ea19f5bd0 Mon Sep 17 00:00:00 2001 From: Yoshiki Miura Date: Mon, 8 Apr 2024 01:58:35 +0900 Subject: [PATCH] Refactor handleClear function in ChatPanel component --- components/chat-panel.tsx | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/components/chat-panel.tsx b/components/chat-panel.tsx index ade8e1f4..f120f073 100644 --- a/components/chat-panel.tsx +++ b/components/chat-panel.tsx @@ -53,13 +53,9 @@ export function ChatPanel() { // Clear messages const handleClear = () => { - // refresh the page - // currently, streamable ui is buggy, so we need to refresh the page to clear the state - window.location.reload() - - // setIsButtonPressed(true); - // setMessages([]); - // setAiMessages([]); + setIsButtonPressed(true) + setMessages([]) + setAiMessages([]) } useEffect(() => {