From 0405206438af9bf343988d856c21a9226f6f37ce Mon Sep 17 00:00:00 2001 From: HyunggyuJang Date: Sat, 18 Mar 2023 11:36:43 +0900 Subject: [PATCH] Remove crypto from client side Unless, if we tries to access the client side page from http protocol, crypto.randomUUID() isn't available. --- client/src/utils/handleSubmit.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/src/utils/handleSubmit.js b/client/src/utils/handleSubmit.js index a9fbdb0d45..32a7d54ea5 100644 --- a/client/src/utils/handleSubmit.js +++ b/client/src/utils/handleSubmit.js @@ -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(); -} \ No newline at end of file +}