mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-09-30 23:27:55 -05:00
Don't show look again once season is done
This commit is contained in:
@@ -79,6 +79,7 @@ import { resolveRoomPass } from "~/features/tournament-bracket/tournament-bracke
|
||||
import { FormWithConfirm } from "~/components/FormWithConfirm";
|
||||
import { addDummySkill } from "../queries/addDummySkill.server";
|
||||
import { inGameNameWithoutDiscriminator } from "~/utils/strings";
|
||||
import { currentSeason } from "~/features/mmr";
|
||||
|
||||
export const links: LinksFunction = () => {
|
||||
return [{ rel: "stylesheet", href: styles }];
|
||||
@@ -209,6 +210,9 @@ export const action = async ({ request, params }: ActionArgs) => {
|
||||
break;
|
||||
}
|
||||
case "LOOK_AGAIN": {
|
||||
const season = currentSeason(new Date());
|
||||
validate(season, "Season is not active");
|
||||
|
||||
const previousGroup = groupForMatch(data.previousGroupId);
|
||||
validate(previousGroup, "Previous group not found");
|
||||
|
||||
@@ -568,7 +572,9 @@ function AfterMatchActions({
|
||||
|
||||
const wasReportedInTheLastHour =
|
||||
databaseTimestampToDate(reportedAt).getTime() > Date.now() - 3600 * 1000;
|
||||
const showLookAgain = role === "OWNER" && wasReportedInTheLastHour;
|
||||
|
||||
const season = currentSeason(new Date());
|
||||
const showLookAgain = role === "OWNER" && wasReportedInTheLastHour && season;
|
||||
|
||||
const wasReportedInTheLastWeek =
|
||||
databaseTimestampToDate(reportedAt).getTime() >
|
||||
|
||||
@@ -104,8 +104,8 @@ export const action: ActionFunction = async ({ request }) => {
|
||||
});
|
||||
|
||||
const season = currentSeason(new Date());
|
||||
validate(!findCurrentGroupByUserId(user.id), "Already in a group");
|
||||
validate(season, "Season is not active");
|
||||
validate(!findCurrentGroupByUserId(user.id), "Already in a group");
|
||||
|
||||
switch (data._action) {
|
||||
case "JOIN_QUEUE": {
|
||||
|
||||
Reference in New Issue
Block a user