Skip to content

Commit 8166f29

Browse files
authored
Merge pull request #75 from ut-code/Projector.tsx
対戦相手を1~4,4~7、に変更しました
2 parents e19d969 + 6fef319 commit 8166f29

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

packages/web/src/projector/Projector.tsx

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,18 @@ async function loadNextLeague(currentLeagueId: number): Promise<League> {
4040
.sort((a, b) => a.rank - b.rank)
4141
);
4242
const nextLeagueId =
43-
users.length > (currentLeagueId + 1) * USER_COUNT_IN_LEAGUE
43+
users.length > (currentLeagueId + 1) * (USER_COUNT_IN_LEAGUE - 1) + 1
4444
? currentLeagueId + 1
4545
: 0;
4646

4747
// リーグに参加できない人のいないよう、下から数えて 4 人を参加させる
48-
const startRank = Math.min(
49-
nextLeagueId * USER_COUNT_IN_LEAGUE,
50-
users.length - USER_COUNT_IN_LEAGUE
51-
);
48+
const startRank =
49+
nextLeagueId !== 0
50+
? Math.min(
51+
nextLeagueId * (USER_COUNT_IN_LEAGUE - 1),
52+
users.length - USER_COUNT_IN_LEAGUE
53+
)
54+
: 0;
5255
// max(User#rank) = users.length - 1
5356
const leagueUsers = users.slice(startRank, startRank + USER_COUNT_IN_LEAGUE);
5457
if (leagueUsers.length !== USER_COUNT_IN_LEAGUE)

0 commit comments

Comments
 (0)