diff --git a/app/components/chat.tsx b/app/components/chat.tsx index bb4b611ad79..90ea8b29b20 100644 --- a/app/components/chat.tsx +++ b/app/components/chat.tsx @@ -481,12 +481,13 @@ export function ChatActions(props: { const [showPluginSelector, setShowPluginSelector] = 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 @@ -506,7 +507,7 @@ export function ChatActions(props: { : nextModel.name, ); } - }, [chatStore, currentModel, models]); + }, [chatStore, currentModel, models, setAttachImages, setUploading]); return (