fix: cma comb dupli on poule list
This commit is contained in:
parent
a73a3562c3
commit
b7a1e58436
@ -64,10 +64,16 @@ export function CategoryContent({cat, catId, setCat}) {
|
|||||||
reducer({type: 'UPDATE_OR_ADD', payload: {...data, c1: data.c1?.id, c2: data.c2?.id}});
|
reducer({type: 'UPDATE_OR_ADD', payload: {...data, c1: data.c1?.id, c2: data.c2?.id}});
|
||||||
combDispatch({type: 'SET_ALL', payload: {source: "match", data: [data.c1, data.c2].filter(d => d != null)}});
|
combDispatch({type: 'SET_ALL', payload: {source: "match", data: [data.c1, data.c2].filter(d => d != null)}});
|
||||||
|
|
||||||
if (data.c1 !== null && !groupsRef.current.some(g => g.id === data.c1?.id))
|
setGroups(prev => {
|
||||||
setGroups(prev => [...prev, {id: data.c1?.id, poule: data.poule}]);
|
if (data.c1 !== null && !prev.some(g => g.id === data.c1?.id))
|
||||||
if (data.c2 !== null && !groupsRef.current.some(g => g.id === data.c2?.id))
|
return [...prev, {id: data.c1?.id, poule: data.poule}];
|
||||||
setGroups(prev => [...prev, {id: data.c2?.id, poule: data.poule}]);
|
return prev;
|
||||||
|
})
|
||||||
|
setGroups(prev => {
|
||||||
|
if (data.c2 !== null && !prev.some(g => g.id === data.c2?.id))
|
||||||
|
return [...prev, {id: data.c2?.id, poule: data.poule}];
|
||||||
|
return prev;
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user