Skip to content

Commit 6db500c

Browse files
committed
Create chat history without refreshing the page
1 parent 53082a0 commit 6db500c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/widgets/ChatMenu/ChatHistory.jsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ function ChatHistory() {
2323
const navigate = useNavigate();
2424
const [selectedChat] = useEvent("CHAT_SELECTED");
2525
const [initChat] = useEvent("CHAT_INITIATED");
26+
const [chatMessageResponded] = useEvent("CHAT_MESSAGE_RESPONDED", null);
2627
const { chatId } = useParams();
2728
const [chats, setChats] = useState([]);
2829
const [, , convertChat, deleteChat] = useChat();
@@ -73,7 +74,7 @@ function ChatHistory() {
7374
}
7475
}
7576
setChats(menu.sort((a, b) => b.created - a.created));
76-
}, [selectedChat, initChat]);
77+
}, [selectedChat, initChat, chatMessageResponded]);
7778

7879
return (
7980
<Box

0 commit comments

Comments
 (0)