dev #73
@ -67,6 +67,9 @@ function CategoryHeader({cat, setCatId}) {
|
||||
useEffect(() => {
|
||||
if (cats && cats.length > 0 && !cat) {
|
||||
setCatId(cats.sort((a, b) => a.name.localeCompare(b.name))[0].id);
|
||||
} else if (cats && cats.length === 0) {
|
||||
setModal({});
|
||||
bthRef.current.click();
|
||||
}
|
||||
}, [cats]);
|
||||
|
||||
@ -77,7 +80,6 @@ function CategoryHeader({cat, setCatId}) {
|
||||
} else { // New category
|
||||
setModal({});
|
||||
bthRef.current.click();
|
||||
console.log(cat);
|
||||
e.target.value = cat?.id;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user