Skip to content

Commit

Permalink
Merge pull request #1042 from Mind-Sports-Games/pla-1144-investigate-…
Browse files Browse the repository at this point in the history
…redirect-of-game-in-swiss-back-to-lobby-on-match

Pla 1144 investigate redirect of game in swiss back to lobby on match
  • Loading branch information
JamesHeppell authored Feb 6, 2025
2 parents ff366d9 + c508133 commit 329746e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ui/draughtsround/src/view/button.ts
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ export function backToTournament(ctrl: RoundController): VNode | undefined {

export function backToSwiss(ctrl: RoundController): VNode | undefined {
const d = ctrl.data;
const moreGamesInMultiMatch = d.game.multiMatch.index < ctrl.data.swiss?.nbGamesPerRound;
const moreGamesInMultiMatch = d.game.multiMatch && d.game.multiMatch.index < ctrl.data.swiss?.nbGamesPerRound;
if (d.swiss?.running && moreGamesInMultiMatch) {
ctrl.setRedirecting();
setTimeout(() => {
Expand Down
2 changes: 1 addition & 1 deletion ui/round/src/view/button.ts
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ export function backToTournament(ctrl: RoundController): VNode | undefined {
export function backToSwiss(ctrl: RoundController): VNode | undefined {
const d = ctrl.data;
const mps = ctrl.finalMultiPointState();
const moreGamesInMultiMatch = d.game.multiMatch.index < ctrl.data.swiss?.nbGamesPerRound;
const moreGamesInMultiMatch = d.game.multiMatch && d.game.multiMatch.index < ctrl.data.swiss?.nbGamesPerRound;
const moreGamesInMultiPoint = mps && mps.p1 < mps.target && mps.p2 < mps.target;
if (d.swiss?.running && (moreGamesInMultiMatch || moreGamesInMultiPoint)) {
ctrl.setRedirecting();
Expand Down

0 comments on commit 329746e

Please sign in to comment.