From 22801591dae59418050055d4ca5799c8ccb65b58 Mon Sep 17 00:00:00 2001 From: Tomoki Yokoyama <89618972+tom0k1@users.noreply.github.com> Date: Tue, 7 Jan 2025 03:46:12 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20artifacts=20key=20in=20object=20does=20n?= =?UTF-8?q?ot=20have=20messages=20property,=20which=20g=E2=80=A6=20(#3812)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fix: artifacts key in object does not have messages property, which gives 'Cannot read properties of undefined (reading reverse) error. So, do not add it to obj variable. Instead, add it to msg object. --- packages/ui/src/ui-component/dialog/ViewMessagesDialog.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/ui/src/ui-component/dialog/ViewMessagesDialog.jsx b/packages/ui/src/ui-component/dialog/ViewMessagesDialog.jsx index 330ae4eed6a..7daab109849 100644 --- a/packages/ui/src/ui-component/dialog/ViewMessagesDialog.jsx +++ b/packages/ui/src/ui-component/dialog/ViewMessagesDialog.jsx @@ -337,8 +337,8 @@ const ViewMessagesDialog = ({ show, dialogProps, onCancel }) => { if (chatmsg.feedback) msg.feedback = chatmsg.feedback?.content if (chatmsg.agentReasoning) msg.agentReasoning = chatmsg.agentReasoning if (chatmsg.artifacts) { - obj.artifacts = chatmsg.artifacts - obj.artifacts.forEach((artifact) => { + msg.artifacts = chatmsg.artifacts + msg.artifacts.forEach((artifact) => { if (artifact.type === 'png' || artifact.type === 'jpeg') { artifact.data = `${baseURL}/api/v1/get-upload-file?chatflowId=${chatmsg.chatflowid}&chatId=${ chatmsg.chatId