fix: clear pub aff when no cat select #117

Merged
Thibaut merged 1 commits from dev into master 2026-03-20 15:11:18 +00:00
Showing only changes of commit d091503f19 - Show all commits

View File

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