fix closed conversation messages

This commit is contained in:
2026-04-18 20:36:46 -06:00
parent 07c3219bec
commit d30f4b7add
2 changed files with 6 additions and 0 deletions

View File

@@ -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 });
}