From 210915f29a30aa2afa0d47cfbb32819718883e9b Mon Sep 17 00:00:00 2001 From: wuzhiqing Date: Fri, 26 Jul 2024 15:47:06 +0800 Subject: [PATCH] chore: adjust useEffect dependencies and destructure props for lint compliance --- app/components/chat.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/components/chat.tsx b/app/components/chat.tsx index 19166c3419d9..1b9d97b6b6cd 100644 --- a/app/components/chat.tsx +++ b/app/components/chat.tsx @@ -479,12 +479,13 @@ export function ChatActions(props: { const [showModelSelector, setShowModelSelector] = useState(false); const [showUploadImage, setShowUploadImage] = useState(false); + const { setAttachImages, setUploading } = props; useEffect(() => { const show = isVisionModel(currentModel); setShowUploadImage(show); if (!show) { - props.setAttachImages([]); - props.setUploading(false); + setAttachImages([]); + setUploading(false); } // if current model is not available @@ -504,7 +505,7 @@ export function ChatActions(props: { : nextModel.name, ); } - }, [chatStore, currentModel, models]); + }, [chatStore, currentModel, models, setAttachImages, setUploading]); return (