add new reducer to ensure conversations are renewed on model change

This commit is contained in:
Daniel Avila 2023-03-09 18:57:37 -05:00
parent 30936573ac
commit 0ba92c4c03
7 changed files with 53 additions and 24 deletions

View file

@ -1,6 +1,6 @@
import React from 'react';
import { useDispatch } from 'react-redux';
import { setConversation } from '~/store/convoSlice';
import { setNewConvo } from '~/store/convoSlice';
import { setMessages } from '~/store/messageSlice';
import { setText } from '~/store/textSlice';
@ -10,7 +10,8 @@ export default function NewChat() {
const clickHandler = () => {
dispatch(setText(''));
dispatch(setMessages([]));
dispatch(setConversation({ title: 'New Chat', error: false, conversationId: null, parentMessageId: null }));
dispatch(setNewConvo());
// dispatch(setConversation({ title: 'New Chat', error: false, conversationId: null, parentMessageId: null }));
};
return (