mirror of
https://github.com/StanGirard/quivr.git
synced 2024-08-16 16:40:40 +03:00
fix(chat): update chats list when creating a new chat
This commit is contained in:
parent
d276126d01
commit
2fa9598fb4
@ -108,11 +108,11 @@ export default function useChats() {
|
||||
};
|
||||
if (!chatId) {
|
||||
// Creating a new chat
|
||||
// setAllChats((chats) => {
|
||||
// console.log({ chats });
|
||||
// return [...chats, newChat];
|
||||
// });
|
||||
console.log("---- Creating a new chat ----");
|
||||
setAllChats((chats) => {
|
||||
console.log({ chats });
|
||||
return [...chats, newChat];
|
||||
});
|
||||
setChat(newChat);
|
||||
router.push(`/chat/${response.data.chatId}`);
|
||||
}
|
||||
@ -139,7 +139,7 @@ export default function useChats() {
|
||||
|
||||
const resetChat = async () => {
|
||||
setChat(null);
|
||||
}
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
fetchAllChats();
|
||||
|
Loading…
Reference in New Issue
Block a user