Skip to content

Commit

Permalink
chore: adjust useEffect dependencies and destructure props for lint c…
Browse files Browse the repository at this point in the history
…ompliance
  • Loading branch information
wuzhiqing committed Jul 26, 2024
1 parent dd769a9 commit 210915f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions app/components/chat.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -504,7 +505,7 @@ export function ChatActions(props: {
: nextModel.name,
);
}
}, [chatStore, currentModel, models]);
}, [chatStore, currentModel, models, setAttachImages, setUploading]);

return (
<div className={styles["chat-input-actions"]}>
Expand Down

0 comments on commit 210915f

Please sign in to comment.