fix closed conversation messages
This commit is contained in:
@@ -440,6 +440,8 @@ function AiChatPage() {
|
|||||||
setMessages([]);
|
setMessages([]);
|
||||||
setError(null);
|
setError(null);
|
||||||
setBotTyping(false);
|
setBotTyping(false);
|
||||||
|
await Promise.all([fetchConversation(convId), fetchMessages(convId)]);
|
||||||
|
connectStomp(convId);
|
||||||
router.replace(`/ai-chat?id=${convId}`, { scroll: false });
|
router.replace(`/ai-chat?id=${convId}`, { scroll: false });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -422,6 +422,10 @@ function ChatPage() {
|
|||||||
if (stompRef.current) { stompRef.current.deactivate(); stompRef.current = null; }
|
if (stompRef.current) { stompRef.current.deactivate(); stompRef.current = null; }
|
||||||
setMessages([]);
|
setMessages([]);
|
||||||
setError(null);
|
setError(null);
|
||||||
|
setSwitchingConv(true);
|
||||||
|
await Promise.all([fetchConversation(convId), fetchMessages(convId)]);
|
||||||
|
setSwitchingConv(false);
|
||||||
|
connectStomp(convId);
|
||||||
router.replace(`/chat?id=${convId}`, { scroll: false });
|
router.replace(`/chat?id=${convId}`, { scroll: false });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user