diff --git a/app/components/chat.tsx b/app/components/chat.tsx index 3d5b6a4f2..5c56e61ac 100644 --- a/app/components/chat.tsx +++ b/app/components/chat.tsx @@ -522,12 +522,14 @@ export function ChatActions(props: { const isMobileScreen = useMobileScreen(); + 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 @@ -547,7 +549,7 @@ export function ChatActions(props: { : nextModel.name, ); } - }, [chatStore, currentModel, models]); + }, [chatStore, currentModel, models, setAttachImages, setUploading]); return (