update dialog position, and clear feedback content after dialog disappear

This commit is contained in:
Henry
2024-03-12 18:46:34 +08:00
parent f16254203e
commit 2853b3149b
2 changed files with 9 additions and 6 deletions
@@ -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 ? (