diff --git a/src/main/webapp/src/pages/competition/editor/CMAdmin.jsx b/src/main/webapp/src/pages/competition/editor/CMAdmin.jsx index 8c56854..54b7546 100644 --- a/src/main/webapp/src/pages/competition/editor/CMAdmin.jsx +++ b/src/main/webapp/src/pages/competition/editor/CMAdmin.jsx @@ -98,7 +98,7 @@ function CategoryHeader({cat, setCatId}) {
{cat &&
Type: {(cat.type & 1) !== 0 ? "Poule" : ""}{cat.type === 3 ? " & " : ""}{(cat.type & 2) !== 0 ? "Tournois" : ""} | - Lice: {cat.liceName}
} + Zone: {cat.liceName}
}
- - Nom des zones de combat (séparée par des ';') + setLice(e.target.value)}/>
diff --git a/src/main/webapp/src/pages/competition/editor/CMTMatchPanel.jsx b/src/main/webapp/src/pages/competition/editor/CMTMatchPanel.jsx index 4b8e048..3d88ca2 100644 --- a/src/main/webapp/src/pages/competition/editor/CMTMatchPanel.jsx +++ b/src/main/webapp/src/pages/competition/editor/CMTMatchPanel.jsx @@ -173,6 +173,10 @@ function MatchList({matches, cat, menuActions}) { .map(m => ({...m, win: win(m.scores)})) const firstIndex = marches2.findLastIndex(m => m.poule === '-') + 1; + const isActiveMatch = (index) => { + return liceName.length === 1 || (liceName[(index - firstIndex) % liceName.length] === lice) + } + const match = matches.find(m => m.id === activeMatch) useEffect(() => { if (!match) { @@ -183,7 +187,7 @@ function MatchList({matches, cat, menuActions}) { payload: { c1: match.c1, c2: match.c2, - next: marches2.filter((m, index) => !m.end && liceName[(index - firstIndex) % liceName.length] === lice && m.id !== activeMatch).map(m => ({ + next: marches2.filter((m, index) => !m.end && isActiveMatch(index) && m.id !== activeMatch).map(m => ({ c1: m.c1, c2: m.c2 })) @@ -198,7 +202,7 @@ function MatchList({matches, cat, menuActions}) { useEffect(() => { if (match && match.poule !== lice) - setActiveMatch(marches2.find((m, index) => !m.end && liceName[(index - firstIndex) % liceName.length] === lice)?.id) + setActiveMatch(marches2.find((m, index) => !m.end && isActiveMatch(index))?.id) }, [lice]); useEffect(() => { @@ -207,12 +211,12 @@ function MatchList({matches, cat, menuActions}) { if (marches2.some(m => m.id === activeMatch)) return; - setActiveMatch(marches2.find((m, index) => !m.end && liceName[(index - firstIndex) % liceName.length] === lice)?.id); + setActiveMatch(marches2.find((m, index) => !m.end && isActiveMatch(index))?.id); }, [matches]) return <> {liceName.length > 1 && -
- +
+