Disabled time typing requirement on dev (#3169)

* checking if mode is dev when adding to daily lb

* disabled time typing check on dev when recalculating leaderboards

* not replacing footer on localhost

* using ternary

* modified logic
This commit is contained in:
Jack 2022-06-20 15:06:35 +02:00 committed by GitHub
parent 6668575cea
commit ae300bfa94
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 3 deletions

View file

@ -327,7 +327,7 @@ export async function addResult(
(funbox === "none" || funbox === "plus_one" || funbox === "plus_two") &&
!bailedOut &&
!user.banned &&
(user.timeTyping ?? 0) > 7200;
(process.env.MODE === "dev" || (user.timeTyping ?? 0) > 7200);
if (dailyLeaderboard && validResultCriteria) {
incrementDailyLeaderboard(result.mode, result.mode2, result.language);

View file

@ -78,7 +78,9 @@ export async function update(
$exists: true,
},
banned: { $exists: false },
timeTyping: { $gt: 7200 },
timeTyping: {
$gt: process.env.MODE === "dev" ? 0 : 7200,
},
},
},
{

View file

@ -133,7 +133,10 @@ function updateFooter(lb: LbKey): void {
return;
}
if ((DB.getSnapshot().globalStats?.time ?? 0) < 7200) {
if (
window.location.hostname !== "localhost" &&
(DB.getSnapshot().globalStats?.time ?? 0) < 7200
) {
$(`#leaderboardsWrapper table.${side} tfoot`).html(`
<tr>
<td colspan="6" style="text-align:center;">Your account must have 2 hours typed to be placed on the leaderboard.</>