From c11d7a40429e99fed7cd9905106d9ceb3fe91bc2 Mon Sep 17 00:00:00 2001 From: Kalle <38327916+Sendouc@users.noreply.github.com> Date: Sat, 26 Feb 2022 13:48:09 +0200 Subject: [PATCH] Don't check group status when reporting score --- app/routes/play/match.$id.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/routes/play/match.$id.tsx b/app/routes/play/match.$id.tsx index 3f9c6ca36..d247b549c 100644 --- a/app/routes/play/match.$id.tsx +++ b/app/routes/play/match.$id.tsx @@ -97,12 +97,14 @@ export const action: ActionFunction = async ({ g.members.some((m) => m.memberId === user.id) ); validate(ownGroup, "Not own match"); - validate(ownGroup.status === "MATCH", "Group doesn't have a match"); validate(isGroupAdmin({ group: ownGroup, user }), "Not group admin"); switch (data._action) { case "REPORT_SCORE": { - if (match.stages.some((stage) => stage.winnerGroupId)) { + const matchWasAlreadyReported = match.stages.some( + (stage) => stage.winnerGroupId + ); + if (matchWasAlreadyReported) { // just don't do anything if they report same as someone else before them // to user it looks identical to if they were the first to submit if (