mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-23 03:40:14 +01:00
chore: Replace hard coded message ID with unique one
This commit is contained in:
parent
08c91871c7
commit
c85602b93b
3 changed files with 35 additions and 6 deletions
|
|
@ -6,6 +6,7 @@ import { setMessages } from '~/store/messageSlice';
|
|||
import { setSubmitState, setSubmission } from '~/store/submitSlice';
|
||||
import { setText } from '~/store/textSlice';
|
||||
import { setError } from '~/store/convoSlice';
|
||||
import {v4} from 'uuid';
|
||||
|
||||
const useMessageHandler = () => {
|
||||
const dispatch = useDispatch();
|
||||
|
|
@ -27,7 +28,7 @@ const useMessageHandler = () => {
|
|||
|
||||
// this is not a real messageId, it is used as placeholder before real messageId returned
|
||||
text = text.trim();
|
||||
const fakeMessageId = '11111111-1111-1111-1111-111111111111';
|
||||
const fakeMessageId = v4();
|
||||
const isCustomModel = model === 'chatgptCustom' || !initial[model];
|
||||
const sender = model === 'chatgptCustom' ? chatGptLabel : model;
|
||||
parentMessageId = parentMessageId || latestMessage?.messageId || '00000000-0000-0000-0000-000000000000';
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue