Remove crypto from client side

Unless, if we tries to access the client side page from http protocol, crypto.randomUUID() isn't available.
This commit is contained in:
HyunggyuJang 2023-03-18 11:36:43 +09:00 committed by Daniel Avila
parent 0af8f6a699
commit 0405206438

View file

@ -27,7 +27,7 @@ const useMessageHandler = () => {
// this is not a real messageId, it is used as placeholder before real messageId returned
text = text.trim();
const fakeMessageId = crypto.randomUUID();
const fakeMessageId = '11111111-1111-1111-1111-111111111111';
const isCustomModel = model === 'chatgptCustom' || !initial[model];
const sender = model === 'chatgptCustom' ? chatGptLabel : model;
parentMessageId = parentMessageId || latestMessage?.messageId || '00000000-0000-0000-0000-000000000000';
@ -161,4 +161,4 @@ export default function handleSubmit({
});
events.stream();
}
}