Skip to content

Commit

Permalink
Create chat history without refreshing the page
Browse files Browse the repository at this point in the history
  • Loading branch information
Abou1205 committed Jul 23, 2024
1 parent 53082a0 commit 6db500c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/widgets/ChatMenu/ChatHistory.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ function ChatHistory() {
const navigate = useNavigate();
const [selectedChat] = useEvent("CHAT_SELECTED");
const [initChat] = useEvent("CHAT_INITIATED");
const [chatMessageResponded] = useEvent("CHAT_MESSAGE_RESPONDED", null);
const { chatId } = useParams();
const [chats, setChats] = useState([]);
const [, , convertChat, deleteChat] = useChat();
Expand Down Expand Up @@ -73,7 +74,7 @@ function ChatHistory() {
}
}
setChats(menu.sort((a, b) => b.created - a.created));
}, [selectedChat, initChat]);
}, [selectedChat, initChat, chatMessageResponded]);

return (
<Box
Expand Down

0 comments on commit 6db500c

Please sign in to comment.