fix: clear pub aff when no cat select
All checks were successful
Deploy Production Server / if_merged (pull_request) Successful in 7m3s

This commit is contained in:
Thibaut Valentin 2026-03-20 16:10:59 +01:00
parent ea17989a82
commit d091503f19

View File

@ -41,6 +41,7 @@ export function CategorieSelect({catId, setCatId, menuActions}) {
const setLoading = useLoadingSwitcher()
const {data: cats, setData: setCats} = useRequestWS('getAllCategory', {}, setLoading);
const {dispatch} = useWS();
const publicAffDispatch = usePubAffDispatch();
const {connected, setText} = useOBS();
const {t} = useTranslation("cm");
@ -70,6 +71,8 @@ export function CategorieSelect({catId, setCatId, menuActions}) {
useEffect(() => {
setText("poule", cat ? cat.name : "");
if (!cat)
publicAffDispatch({type: 'SET_DATA', payload: {c1: undefined, c2: undefined, next: []}});
}, [cat, connected]);
return <>