updated model selector to not call function when model is empty

This commit is contained in:
Lucas Oliveira 2025-10-02 14:09:31 -03:00
parent 535841e882
commit 8360388101

View file

@ -44,7 +44,7 @@ export function ModelSelector({
const [searchValue, setSearchValue] = useState(""); const [searchValue, setSearchValue] = useState("");
useEffect(() => { useEffect(() => {
if (value && (!options.find((option) => option.value === value) && !custom)) { if (value && value !== "" && (!options.find((option) => option.value === value) && !custom)) {
onValueChange(""); onValueChange("");
} }
}, [options, value, custom, onValueChange]); }, [options, value, custom, onValueChange]);