From fecb3440a9ae65e4c208be4e40ab0e7e20a27ad6 Mon Sep 17 00:00:00 2001
From: zkldi <20380519+zkldi@users.noreply.github.com>
Date: Sat, 24 Dec 2022 11:55:40 +0000
Subject: [PATCH] fix: allow decimals for mmdx imports (HACK)
---
.../app/pages/dashboard/import/ImportPage.tsx | 22 +++++++++----------
common/src/lib/schemas.ts | 10 +++++++--
2 files changed, 19 insertions(+), 13 deletions(-)
diff --git a/client/src/app/pages/dashboard/import/ImportPage.tsx b/client/src/app/pages/dashboard/import/ImportPage.tsx
index 083056d2e..110bfce44 100644
--- a/client/src/app/pages/dashboard/import/ImportPage.tsx
+++ b/client/src/app/pages/dashboard/import/ImportPage.tsx
@@ -88,7 +88,11 @@ function InnerShowRecentImports({ user }: { user: UserDocument }) {
return ;
}
- if (data.length === 0) {
+ const filteredData = data.filter(
+ (e) => e.importType.startsWith("file/") || e.importType.startsWith("api/")
+ );
+
+ if (filteredData.length === 0) {
return null;
}
@@ -97,16 +101,12 @@ function InnerShowRecentImports({ user }: { user: UserDocument }) {
Recently Used Import Methods
- {data
- .filter(
- (e) => e.importType.startsWith("file/") || e.importType.startsWith("api/")
- )
- .map((e) => (
-
- ))}
+ {filteredData.map((e) => (
+
+ ))}
>
);
diff --git a/common/src/lib/schemas.ts b/common/src/lib/schemas.ts
index 6709dc41f..c4a682f17 100644
--- a/common/src/lib/schemas.ts
+++ b/common/src/lib/schemas.ts
@@ -1296,8 +1296,14 @@ const PR_HIT_META = (game: Game): PrudenceSchema => {
const PR_BATCH_MANUAL_SCORE = (game: Game, playtype: Playtype): PrudenceSchema => {
const gptConfig = GetGamePTConfig(game, playtype);
- const scoreChecker =
- game === "itg" || game === "gitadora" ? p.isBetween(0, 100) : p.isPositiveInteger;
+ let scoreChecker: ValidSchemaValue = p.isPositiveInteger;
+
+ // DISGUSTING TEMPORARY HACK. NEEDS REFACTOR
+ if (game === "itg" || game === "gitadora") {
+ scoreChecker = p.isBetween(0, 100);
+ } else if (game === "maimaidx") {
+ scoreChecker = p.isBetween(0, 101);
+ }
return {
score: scoreChecker,