mirror of
https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
synced 2025-10-01 15:46:39 +08:00
fix: resolve useEffect dependency warnings
This commit is contained in:
parent
26c3edd023
commit
43b74b4aa8
@ -510,12 +510,14 @@ export function ChatActions(props: {
|
|||||||
|
|
||||||
const isMobileScreen = useMobileScreen();
|
const isMobileScreen = useMobileScreen();
|
||||||
|
|
||||||
|
const { setAttachImages, setUploading } = props;
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const show = isVisionModel(currentModel);
|
const show = isVisionModel(currentModel);
|
||||||
setShowUploadImage(show);
|
setShowUploadImage(show);
|
||||||
if (!show) {
|
if (!show) {
|
||||||
props.setAttachImages([]);
|
setAttachImages([]);
|
||||||
props.setUploading(false);
|
setUploading(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
// if current model is not available
|
// if current model is not available
|
||||||
@ -535,7 +537,7 @@ export function ChatActions(props: {
|
|||||||
: nextModel.name,
|
: nextModel.name,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}, [chatStore, currentModel, models]);
|
}, [chatStore, currentModel, models, setAttachImages, setUploading]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={styles["chat-input-actions"]}>
|
<div className={styles["chat-input-actions"]}>
|
||||||
|
Loading…
Reference in New Issue
Block a user