fix: select same model will clear filename

This commit is contained in:
jialin
2024-10-18 10:59:01 +08:00
parent e10c5e28b5
commit 594c4cd670
4 changed files with 14 additions and 6 deletions
@@ -54,7 +54,6 @@ const AddModal: React.FC<AddModalProps> = (props) => {
}, []);
const handleOnSelectModel = (item: any) => {
handleSelectModelFile({ fakeName: '' });
setSelectedModel(item);
};
@@ -73,6 +72,10 @@ const AddModal: React.FC<AddModalProps> = (props) => {
}
};
useEffect(() => {
handleSelectModelFile({ fakeName: '' });
}, [selectedModel]);
useEffect(() => {
return () => {
setSelectedModel({});