core: fix contest first display

This commit is contained in:
undefined committed 2021-09-20 18:17:00 +08:00
1 parent 9716e7caa2
commit 90283a3944
2 files changed
+18 -23

No files matched your search

+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "hydrooj", "name": "hydrooj",
"version": "2.36.9", "version": "2.36.10",
"bin": "bin/hydrooj.js", "bin": "bin/hydrooj.js",
"main": "src/loader", "main": "src/loader",
"module": "src/loader", "module": "src/loader",
+17 -22
View File
@@ -241,33 +241,28 @@ const oi: ContestRule = {
const index = pid.toString().includes(':') const index = pid.toString().includes(':')
? `${tsdoc.uid}/${pid.toString().replace(':', '/')}` ? `${tsdoc.uid}/${pid.toString().replace(':', '/')}`
: `${tsdoc.uid}/${tdoc.domainId}/${pid}`; : `${tsdoc.uid}/${tdoc.domainId}/${pid}`;
// eslint-disable-next-line @typescript-eslint/no-use-before-define const node: ScoreboardNode =
if (isDone(tdoc) && tsddict[pid]?.rid?.toHexString() !== psdict[index]?.rid?.toHexString()) { // eslint-disable-next-line @typescript-eslint/no-use-before-define
row.push({ isDone(tdoc) && tsddict[pid]?.rid?.toHexString() !== psdict[index]?.rid?.toHexString()
type: 'records', ? {
value: '', type: 'records',
raw: [ value: '',
{ raw: [{
value: tsddict[pid]?.score ?? '-', value: tsddict[pid]?.score ?? '-',
raw: tsddict[pid]?.rid || null, raw: tsddict[pid]?.rid || null,
}, }, {
{
value: psdict[index]?.score ?? '-', value: psdict[index]?.score ?? '-',
raw: psdict[index]?.rid ?? null, raw: psdict[index]?.rid ?? null,
}, }],
], } : {
}); type: 'record',
} else { value: tsddict[pid]?.score ?? '-',
const node: ScoreboardNode = { raw: tsddict[pid]?.rid || null,
type: 'record', };
value: tsddict[pid]?.score ?? '-', if (tsddict[pid]?.status === STATUS.STATUS_ACCEPTED && tsddict[pid]?.rid.generationTime === first[pid]) {
raw: tsddict[pid]?.rid || null, node.style = 'background-color: rgb(217, 240, 199);';
};
if (tsddict[pid]?.status === STATUS.STATUS_ACCEPTED && tsddict[pid]?.rid.generationTime === first[pid]) {
node.style = 'background-color: rgb(217, 240, 199);';
}
row.push(node);
} }
row.push(node);
} }
rows.push(row); rows.push(row);
} }