vjudge: result: follow detail config (#582)

This commit is contained in:
undefined committed 2023-06-22 10:24:21 +08:00
1 parent 8a99fc9aa6
commit 02bf79001d
1 file changed
+6 -1
+6 -1
View File
@@ -53,7 +53,12 @@ class AccountService {
const rid = await this.api.submitProblem(task.target, task.lang, task.code, task, next, end);
if (!rid) return;
await next({ status: STATUS.STATUS_JUDGING, message: `ID = ${rid}` });
await this.api.waitForSubmission(rid, next, end);
const nextFunction = (data) => {
if (data.case) delete data.case.message;
if (data.cases) data.cases.forEach((x) => delete x.message);
return next(data);
};
await this.api.waitForSubmission(rid, task.config?.detail === false ? nextFunction : next, end);
} catch (e) {
if (process.env.DEV) {
logger.error(e);