From 2853b3149bf3b049e1db9b0e5704ce4644f59776 Mon Sep 17 00:00:00 2001 From: Henry Date: Tue, 12 Mar 2024 18:46:34 +0800 Subject: [PATCH] update dialog position, and clear feedback content after dialog disappear --- .../ui-component/dialog/ChatFeedbackContentDialog.jsx | 5 ++++- packages/ui/src/views/chatmessage/ChatMessage.jsx | 10 +++++----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/packages/ui/src/ui-component/dialog/ChatFeedbackContentDialog.jsx b/packages/ui/src/ui-component/dialog/ChatFeedbackContentDialog.jsx index 3bb5524d..6b34aeca 100644 --- a/packages/ui/src/ui-component/dialog/ChatFeedbackContentDialog.jsx +++ b/packages/ui/src/ui-component/dialog/ChatFeedbackContentDialog.jsx @@ -27,7 +27,10 @@ const ChatFeedbackContentDialog = ({ show, onCancel, onConfirm }) => { useEffect(() => { if (show) dispatch({ type: SHOW_CANVAS_DIALOG }) else dispatch({ type: HIDE_CANVAS_DIALOG }) - return () => dispatch({ type: HIDE_CANVAS_DIALOG }) + return () => { + dispatch({ type: HIDE_CANVAS_DIALOG }) + setFeedbackContent('') + } }, [show, dispatch]) const component = show ? ( diff --git a/packages/ui/src/views/chatmessage/ChatMessage.jsx b/packages/ui/src/views/chatmessage/ChatMessage.jsx index 9e748fc0..e083552a 100644 --- a/packages/ui/src/views/chatmessage/ChatMessage.jsx +++ b/packages/ui/src/views/chatmessage/ChatMessage.jsx @@ -871,11 +871,6 @@ export const ChatMessage = ({ open, chatflowid, isDialog, previews, setPreviews /> ) : null} - setShowFeedbackContentDialog(false)} - onConfirm={submitFeedbackContent} - /> ) : null} {message.fileAnnotations && ( @@ -1124,6 +1119,11 @@ export const ChatMessage = ({ open, chatflowid, isDialog, previews, setPreviews )} setSourceDialogOpen(false)} /> + setShowFeedbackContentDialog(false)} + onConfirm={submitFeedbackContent} + /> ) }