Fixed the redux state changes

This commit is contained in:
Niharika Goulikar
2024-10-18 09:55:33 +00:00
parent 1757ce23af
commit 5854202f22
2 changed files with 11 additions and 7 deletions

View File

@@ -96,6 +96,9 @@ export default function Navigation({ navOpen, setNavOpen }: NavigationProps) {
if (!conversations) {
fetchConversations();
}
if (queries.length === 0) {
resetConversation();
}
}, [conversations, dispatch]);
async function fetchConversations() {
@@ -168,9 +171,8 @@ export default function Navigation({ navOpen, setNavOpen }: NavigationProps) {
);
};
const newChat = () => {
if (conversations && conversations?.length > 0) {
if (queries && queries?.length > 0) {
resetConversation();
navigate('/');
}
};
async function updateConversationName(updatedConversation: {