fix(chatGPTBrowser): render markdown formatting by setting isCreatedByUser, fix(useMessageHandler): avoid double appearance of cursor by setting latest message at initial response creation time

This commit is contained in:
Danny Avila 2023-08-25 09:13:50 -04:00 committed by Danny Avila
parent 9ef1686e18
commit ae5c06f381
2 changed files with 12 additions and 3 deletions

View file

@ -6,7 +6,7 @@ import type { TAskFunction } from '~/common';
import store from '~/store';
const useMessageHandler = () => {
const latestMessage = useRecoilValue(store.latestMessage);
const [latestMessage, setLatestMessage] = useRecoilState(store.latestMessage);
const setSiblingIdx = useSetRecoilState(
store.messagesSiblingIdxFamily(latestMessage?.parentMessageId),
);
@ -134,6 +134,7 @@ const useMessageHandler = () => {
} else {
setMessages([...submission.messages, currentMsg, initialResponse]);
}
setLatestMessage(initialResponse);
setSubmission(submission);
};