mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-08-27 05:36:28 -05:00
Fix server error when match does not yet have both teams set
This commit is contained in:
@@ -147,18 +147,18 @@ export const loader = async ({ params }: LoaderFunctionArgs) => {
|
||||
if (
|
||||
match.chatCode &&
|
||||
!matchIsOver &&
|
||||
match.opponentOne &&
|
||||
match.opponentTwo
|
||||
match.opponentOne?.id &&
|
||||
match.opponentTwo?.id
|
||||
) {
|
||||
// only add global chat for active roster (or all if not yet set i.e. first match)
|
||||
// if roster changed mid-set the subs can still see the chat on the match page
|
||||
const teamAlpha = tournament.teamById(match.opponentOne.id!)!;
|
||||
const teamAlpha = tournament.teamById(match.opponentOne.id)!;
|
||||
const teamAlphaActiveRoster =
|
||||
tournamentTeamToActiveRosterUserIds(
|
||||
teamAlpha,
|
||||
tournament.minMembersPerTeam,
|
||||
) ?? teamAlpha.members.map((m) => m.userId);
|
||||
const teamBravo = tournament.teamById(match.opponentTwo.id!)!;
|
||||
const teamBravo = tournament.teamById(match.opponentTwo.id)!;
|
||||
const teamBravoActiveRoster =
|
||||
tournamentTeamToActiveRosterUserIds(
|
||||
teamBravo,
|
||||
|
||||
@@ -866,7 +866,7 @@ test.describe("Tournament bracket", () => {
|
||||
});
|
||||
|
||||
test("locks/unlocks matches & sets match as casted", async ({ page }) => {
|
||||
test.setTimeout(120000);
|
||||
test.slow();
|
||||
|
||||
const tournamentId = 2;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user