diff --git a/web/app/ai-chat/page.js b/web/app/ai-chat/page.js index 13ed9ae4..64f3ae80 100644 --- a/web/app/ai-chat/page.js +++ b/web/app/ai-chat/page.js @@ -440,6 +440,8 @@ function AiChatPage() { setMessages([]); setError(null); setBotTyping(false); + await Promise.all([fetchConversation(convId), fetchMessages(convId)]); + connectStomp(convId); router.replace(`/ai-chat?id=${convId}`, { scroll: false }); } diff --git a/web/app/chat/page.js b/web/app/chat/page.js index 17d7c42c..a52eed4d 100644 --- a/web/app/chat/page.js +++ b/web/app/chat/page.js @@ -422,6 +422,10 @@ function ChatPage() { if (stompRef.current) { stompRef.current.deactivate(); stompRef.current = null; } setMessages([]); setError(null); + setSwitchingConv(true); + await Promise.all([fetchConversation(convId), fetchMessages(convId)]); + setSwitchingConv(false); + connectStomp(convId); router.replace(`/chat?id=${convId}`, { scroll: false }); }